News:

Welcome to RetroCoders Community

Main Menu

GW Basic Program "CLOSURE.BAS"

Started by ron77, Nov 20, 2023, 05:26 PM

Previous topic - Next topic

ron77

10 REM CLOSURE WITH THE PAST PROGRAM
20 REM A PROGRAM TO SIMULATE A CLOSURE CONVERSATION WITH SOMEONE FROM YOUR PAST
30 REM BY RON77 - 2023
40 REM VARIABLES INIITIALISATION
50 REM
60 PERSONCOUNTER = 0: USERCOUNTER = 0: FLAG1=0 : FLAG2=0
70 DIM PERSON$(100): DIM USER$(100): RANDOMIZE TIMER
80 REM MAIN PROGRAM
85 SCREEN 0: WIDTH 80:COLOR 15,0:KEY OFF:CLS
90 PRINT "WELCOME TO CLOSURE WITH THE PAST PROGRAM"
92 PRINT "BY RON77 - 2023"
95 PRINT "THIS PROGRAM WILL HELP YOU TO HAVE CLOSURE WITH SOMEONE FROM YOUR PAST"
97 PRINT "THIS PROGRAM DOES NOT SAVE ANY DATA ON YOUR COMPUTER"
98 PRINT "ALL DATA AND MEMORY CONTENT WILL BE LOST WHEN YOU EXIT THE PROGRAM"
100 PRINT "PLEASE ENTER THE NAME OF THE PERSON YOU WANT TO HAVE CLOSURE WITH"
110 INPUT ">", PERSON1$
115 IF PERSON1$ = "" THEN PERSON1$ = "THE PERSON"
120 CLS
130 REM MAIN LOOP
135 PRINT "WELCOME TO CLOSURE WITH THE PAST PROGRAM"
140 PRINT "1. WHAT WOULD YOU LIKE TO SAY TO "; PERSON1$
150 PRINT "2. WHAT WOULD YOU LIKE TO HEAR FROM "; PERSON1$
160 PRINT "3. SIMULATE A CONVERSATION WITH "; PERSON1$;" (RANDOM)"
170 PRINT "4. EXIT"
180 INPUT ">", CHOICE
190 IF CHOICE < 1 OR CHOICE > 4 THEN GOTO 180
200 IF CHOICE = 3 AND FLAG1=0 AND FLAG2=0 THEN PRINT "YOU NEED TO ENTER FIRST OPTION 1 AND 2":WHILE INKEY$="": WEND :GOTO 120
210 ON CHOICE GOSUB 1000, 2000, 3000, 4000
220 GOTO 120

1000 REM WHAT WOULD YOU LIKE TO SAY TO PERSON
1010 CLS
1015 PRINT
1020 PRINT "WHAT WOULD YOU LIKE TO SAY TO "; PERSON1$
1025 USERCOUNTER = USERCOUNTER + 1
1030 INPUT ">", USER$(USERCOUNTER)
1040 REM
1045 FLAG1 = 1
1050 RETURN

2000 REM WHAT WOULD YOU LIKE TO HEAR FROM PERSON
2010 CLS
2015 PRINT
2020 PRINT "WHAT WOULD YOU LIKE TO HEAR FROM "; PERSON1$
2025 PERSONCOUNTER = PERSONCOUNTER + 1
2030 INPUT ">", PERSON$(PERSONCOUNTER)
2040 REM
2045 FLAG2 = 1
2050 RETURN

3000 REM SIMULATE A CONVERSATION WITH PERSON
3010 CLS
3020 PRINT "SIMULATING A CONVERSATION WITH "; PERSON1$
3030 PRINT "HOW MUCH CYCLES DO YOU WANT TO SIMULATE?(1-20)"
3040 INPUT ">", CYCLES
3050 IF CYCLES <1 OR CYCLES >20 THEN GOTO 3040
3060 FOR I = 1 TO CYCLES
3070 CLS
3080 PRINT: PRINT "YOU SAY TO "; PERSON1$;": ";USER$(INT(RND * USERCOUNTER) +1)
3090 T!=TIMER+5: WHILE TIMER < T!: WEND
3100 PRINT: PRINT PERSON1$;" SAYS TO YOU: ";PERSON$(INT(RND * PERSONCOUNTER) +1)
3110 T!=TIMER+5: WHILE TIMER < T!: WEND
3120 NEXT I
3130 PRINT "PRESS ANY KEY TO CONTINUE"
3140 WHILE INKEY$="": WEND
3150 RETURN

4000 REM EXIT
4010 CLS
4020 PRINT "ARE YOU SURE YOU WANT TO EXIT?(Y/N)"
4030 INPUT ">", EXIT$
4040 IF EXIT$ = "Y" OR EXIT$ = "y" THEN END
4050 RETURN