Tuesday, 17 May 2016

APPLE II ARTIFICIAL INTELLIGENCE

By the study and fruit of programming of ME and Mark D. Overholser is born this Artificial intelligence, here the code:

5 DIM A$(8): DIM B(8): DIM C$(8)
6 N = 1
10 A$(1) = "HOW ARE YOU":B(1) = 1
15 C$(1) = "HOW LONG HAVE YOU FELT "
20 A$(2) = "WHAT IS YOUR NAME":B(2) = 1
25 C$(2) = "WELL MY NAME IS ELIZA, GLAD TO MEET YOU, "
30 A$(3) = "HOW OLD ARE YOU":B(3) = 1
35 C$(3) = "I AM ONLY 1"
40 A$(4) = "WHAT IS YOUR JOB":B(4) = 1
45 C$(4) = "I AM A COMPUTER THERAPIST."
50 A$(5) = "WHAT FRIGHTENS YOU ":B(5) = 1
55 C$(5) = "I AM FRIGHTENED OF TECHNOLOGY."
60 A$(6) = "WHAT IS YOUR BIGGEST SUCCESS":B(6) = 1
65 C$(6) = "MINE IS HELPING PEOPLE LIKE YOU."
70 A$(7) = "ARE YOU A MAN OR A WOMAN":B(7) = 1
75 C$(7) = "I'M AN ARTIFICIAL INTELLIGENCE, CAN BE SOON A ROBOT!"
80 A$(8) = "DO YOU WANT TO PLAY A GAME WITH ME" : B(8)=1
85 C$(8) = "OK.. WE CAN PLAY LATER"
100 FOR I = 1 TO 100
110 J = INT (8 * RND (N) + 1)
120 IF B(J) = 1 THEN GOSUB 200
130 NEXT I
140 END
200 PRINT A$(J)
210 INPUT AA$
220 IF J = 1 THEN ? C$(J); AA$ : B(J) = 0 : GOTO 280
230 IF J = 2 THEN ? C$(J); AA$ : B(J) = 0 : GOTO 280
260 IF J = 8 AND AA$ = "YES" THEN GOSUB 500 : GOTO 280
265 IF J = 8 AND AA$ <> "YES" THEN PRINT C$(J) : GOTO 280
270 PRINT C$(J) : B(J) = 0
280 PRINT
290 RETURN
500 INPUT "YOUR NUMBER: ";NA
510 NB = INT (1000 * RND (1) + 1)
520 HTAB 5: PRINT "YOUR NUMBER IS: ";NA
530 HTAB 5: PRINT "COMPUTER NUMBER IS: ";NB
550 IF NA = NB THEN PRINT "YOU WIN!!!!!"
560 IF NA < > NB THEN PRINT "YOU LOSE"
570 RETURN

Dont have fear if you dont have a real APPLE ][ here there is a really nice windows emulator to try my Artificial intelligence:
APPLEWIN FOR WINDOWS APPLE ][ EMULATOR

Enjoy!

No comments:

Post a Comment