News:

Welcome to RetroCoders Community

Main Menu

Recent posts

#92
gwbasic / Re: GW Basic Links
Last post by CharlieJV - Nov 21, 2023, 01:52 AM
GWBASIC.EXE in a DosBox emulator at the internet archive: https://archive.org/details/gwbasic.exe

Kind of handy for testing short code snippets.

Oh, and GW-BASIC books at the internet archive: https://archive.org/search?query=subject%3A%22GW-BASIC%22&and%5B%5D=mediatype%3A%22texts%22

And GW-BASIC programs at Rosetta Code: https://rosettacode.org/wiki/Category:GW-BASIC

#93
gwbasic / GW Basic Program "CLOSURE.BAS"
Last post by ron77 - Nov 20, 2023, 05:26 PM
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
#94
gwbasic / GW Basic Adventure Game - TITA...
Last post by ron77 - Nov 20, 2023, 03:05 PM
10 REM TITANIC ADVENTURE GAME - ESCAPE THE SINKING SHIP
20 REM BY RON77
30 REM VERSION 1.0
40 REM VARIABLES INITIALIZATION
41 DIM ROOM$(10): RO=1: SC=0: DIM DIRECTION(10,4):DIM ITEMS1$(6), ITEMS2$(6), TR(6), INV$(6),DES$(6):PAY =0: KEY1=0: UNI=0
42 GOSUB 59970

100 REM INTERFACE INITIALIZATION
110 SCREEN 0:WIDTH 80: KEY OFF: CLS
111 LOCATE 21,1: PRINT "TITANIC - escape the sinking ship"
120 GOSUB 58900 : REM ROOM DESCRIPTION
125 GOSUB 53500 : REM ITEMS IN THE ROOM
124 REM INPUT HANDLING
129 KW=0
130 INPUT">", A$
131 IF A$="" THEN PRINT:PRINT "what?." : GOTO 130
140 A = ASC(A$): IF A<65 OR A>90 THEN PRINT:PRINT "use capital letters only": GOTO 130
150 M=LEN(A$): IF M<7 THEN A$=A$+" ": GOTO 150
155 B$=LEFT$(A$,3)
160 IF B$="NOR" OR B$= "N  " THEN D=1: GOSUB 55000: GOSUB 53500:GOTO 130
170 IF B$="SOU" OR B$= "S  " THEN D=3: GOSUB 55000: GOSUB 53500:GOTO 130
180 IF B$="EAS" OR B$= "E  " THEN D=2: GOSUB 55000: GOSUB 53500: GOTO 130
190 IF B$="WES" OR B$= "W  " THEN D=4: GOSUB 55000: GOSUB 53500:GOTO 130
200 IF B$="HEL" OR B$="H  " THEN GOSUB 54000 :GOTO 130
210 IF B$="QUI" OR B$="Q  " THEN GOTO 59410
220 IF B$="LOO" OR B$="L  " THEN GOSUB 58900: GOSUB 53500 :GOTO 130
230 IF B$="INV" OR B$="I  " THEN GOSUB 53000: GOTO 130 

250 N=1
260 IF MID$(A$,N,1)=" " THEN C$=MID$(A$,N+1,3):IF LEFT$(C$,1)<>" " THEN 290 ELSE 280
270 IF N<M THEN N=N+1:GOTO 260
280 PRINT "in that form i cannot understand what you mean by ";A$: GOTO 130
290 IF B$="TAK" OR B$="GET" THEN KW =1: GOSUB 52500: GOTO 130
300 IF B$="DRO" OR B$="PUT" THEN KW =1: GOSUB 52000: GOTO 130
310 IF B$="EXA" THEN GOSUB 51900:GOTO 130
320 IF B$="USE" OR B$="U" THEN GOSUB 51500: GOTO 130

1500 PRINT : PRINT "i don't know that word.": GOTO 130

51500 REM USE ITEMS
51505 IF C$="MON" OR C$="WAL" AND TR(1) =200 AND RO=9 THEN PRINT: PRINT "you give the money to the guard": PAY=1: RETURN
51506 IF C$="KEY" AND TR(4)=200 AND RO=6 THEN PRINT:PRINT "you use the key to open the elevator door": KEY1=1: RETURN
51507 IF C$="LIF" AND TR(5)=200 THEN PRINT:PRINT "you put on the life suit": RETURN
51508 IF C$="UNI" AND TR(6)=200 THEN UNI=1:PRINT:PRINT "you put on the boat crew uniform": RETURN
51509 IF C$="GUN" AND TR(3)=200 AND RO=9 THEN PRINT: PRINT "you draw the gun but the guard punch you in the face":PRINT "more guards come and take you away and lock you in one of the cells you drown with the ship - GAME OVER": END 
51510 IF C$="KNI" AND TR(2)=200 AND RO=9 THEN PRINT: PRINT "you draw the knife but the guard punch you in the face":PRINT "more guards come and take you away and lock you in one of the cells you drown with the ship - GAME OVER": END
51520 PRINT: PRINT "you either can't use that item here or don't have that item with you.": RETURN


51900 REM LOOK AT ITEMS
51905 OBJECT=0
51910 FOR I = 1 TO 6
51915 IF C$=ITEMS1$(I) AND TR(I) = 200 THEN OBJECT=I: PRINT: PRINT DES$(I): RETURN
51945 NEXT I
51950 IF OBJECT=0 THEN PRINT:PRINT "i don't have that object with you...":RETURN
51960 RETURN




52000 REM DROP ITEMS
52005 OBJECT=0: FLAG=0
52010 FOR I = 1 TO 6
52015 IF TR(I) = 200 THEN FLAG = 1
52020 NEXT I
52025 IF FLAG = 0 THEN PRINT: PRINT "you are not carrying anything":RETURN
52030 FOR I = 1 TO 6
52035 IF C$=ITEMS1$(I) AND TR(I) = 200 THEN OBJECT=I :PRINT: PRINT "ok. you drop ";INV$(OBJECT)
52038 NEXT I
52040 IF OBJECT=0 THEN PRINT:PRINT "you are not holding that object":RETURN
52050 TR(OBJECT)=RO
52055 PRINT: PRINT "ok."
52060 RETURN

52500 REM PICK UP ITEMS
52505 OBJECT=0
52510 FOR I = 1 TO 6
52515 IF C$=ITEMS1$(I) AND TR(I) = RO THEN OBJECT=I :PRINT: PRINT "ok. you pick up ";INV$(OBJECT)
52520 NEXT I
52325 REM
52530 IF OBJECT=0 THEN PRINT :PRINT "i don't see that object here...":RETURN
52540 TR(OBJECT)=200
52545 PRINT: PRINT "ok."
52550 RETURN


53000 REM INVENTORY ROUTINE
53010 PRINT: PRINT "  you are carrying: "
53020 FOR I = 1 TO 6
53030 IF TR(I) = 200 THEN PRINT "   ";INV$(I): AADS = 1
53040 NEXT I
53050 IF AADS <> 1 THEN PRINT "  nothing  "
53060 AADS = 0
53070 RETURN

53500 REM ITEMS IN A THE ROOM
53510 FOR I = 1 TO 6 
53511 IF TR(I)=RO THEN  PRINT ITEMS2$(I)
53512 NEXT I
53520 RETURN

54000 REM HELP
54010 PRINT: PRINT "TITANIC - escape the sinking ship"
54020 PRINT "you are on the titanic, the ship is sinking"
54030 PRINT "you must escape the ship before it sinks"
54040 PRINT "you can go north, south, east or west"
54050 PRINT "you can also go to the help screen by typing 'HELP'"
54060 PRINT "type 'NORTH', 'SOUTH', 'EAST' or 'WEST' or 'N', 'S', 'E' or 'W' to move 'H' or 'HELP' for help"
54070 PRINT "'Q' or 'QUIT' to quit - 'I' or 'INVENTORY' for inventory - 'TAKE' or 'GET' for picking up items 'PUT' or 'DROP' to drop item - 'U' or 'USE' to use item"
54080 RETURN

55000 REM DIRECTION HANDLING
55001 REM 
55002 REM
55003 IF RO=6 AND KEY1=0 AND D=3 THEN PRINT: PRINT "the elevator door is locked": RETURN
55004 IF RO=6 AND KEY1=1 AND D=3 THEN RO = 7: PRINT :PRINT "the elevator door opens": GOSUB 58900: RETURN
55005 IF RO=9 AND UNI=1 AND D=3 THEN RO=10: PRINT: PRINT "you are on the lifeboat": GOSUB 58900: END
55006 IF RO=9 AND PAY =1 AND D=3 THEN RO=10: PRINT: PRINT "you are on the lifeboat": GOSUB 58900: END
55007 IF RO=9 AND PAY =0 AND D=3 THEN PRINT: PRINT "the guard won't let you aboard the lifeboat": RETURN
55010 IF DIRECTION(RO,D)<>-1 THEN RO=DIRECTION(RO,D):SC=SC+1: PRINT: PRINT "you go into "; ROOM$(RO): GOSUB 58900
55020 IF DIRECTION(RO,D)=-1 THEN PRINT:PRINT "you can't go that way"
55030 RETURN



58900 COLOR 0,7
58910 LOCATE 25,1: PRINT SPACE$(80)
58920 LOCATE 25,1: PRINT ROOM$(RO)
58925 LOCATE 25,40: PRINT "score: ";SC
58930 COLOR 7,0
58940 REM LOCATE 24,1
58950 ON RO GOSUB 59370,59330,59290,59250,59210,59170,59120,59080,59040,59000
58960 RETURN

59000 REM ROOMS DESCRIPTIONS SUBROUTIME
59010 REM LIFEBOAT
59020 PRINT "you are in a lifeboat on the sea, you are safe - GAME OVER"
59030 RETURN
59040 REM BOAT DECK
59050 PRINT "you are on the boat deck, you can see the lifeboats"
59055 PRINT "there is a guard here, he is guarding the lifeboats"
59060 PRINT "you can go to the bridge, the main deck or the lifeboats"
59070 RETURN
59080 REM MAIN DECK
59090 PRINT "you are on the main deck, you can see the lifeboats far away"
59105 PRINT "there is mayhem everywhere, people are running around"
59106 PRINT "people are waiting to get aboard the lifeboats"
59107 PRINT "guards are shooting at people to keep order"
59100 PRINT "you can go to the bridge, the boat deck or the elevator"
59110 RETURN
59120 REM BRIDGE
59130 PRINT "you are on the bridge, you can see the captain"
59140 PRINT "the captain is giving orders to the crew"
59150 PRINT "you can go to the main deck or the boat deck"
59160 RETURN
59170 REM ELEVATOR
59180 PRINT "you are in the elevator, you can see the main deck"
59185 PRINT "there is a key hole on the elevator door"
59190 PRINT "you can go to the boiler room or the main deck"
59200 RETURN
59210 REM CARGO HOLD
59220 PRINT "you are in the cargo hold, you can see the boiler room"
59230 PRINT "you can go to the boiler room or the engine room"
59240 RETURN
59250 REM ENGINE ROOM
59260 PRINT "you are in the engine room, you can see the cargo hold"
59270 PRINT "you can go to the cargo hold or the boiler room"
59280 RETURN
59290 REM BOILER ROOM
59300 PRINT "you are in the boiler room, you can see the cargo hold"
59310 PRINT "you can go to the cargo hold or the engine room"
59320 RETURN
59330 REM GALLOW DECK
59340 PRINT "you are in the gallow deck, you can see the passenger cell"
59350 PRINT "you can go to the passenger cell or the boiler room"
59360 RETURN
59370 REM PASSENGER CELL
59380 PRINT "you are in the passenger cell, you can see the gallow deck"
59390 PRINT "you can go to the gallow deck or the boiler room"
59400 RETURN
59410 REM GAME OVER
59420 PRINT:PRINT "you are dead, game over"
59430 PRINT "press any key to continue"
59440 END

59970 REM INITIALIZATION SUBROUTINE
59975 FOR I = 1 TO 10: READ ROOM$(I): NEXT I
59980 FOR I = 1 TO 10: FOR J = 1 TO 4: READ DIRECTION(I,J): NEXT J: NEXT I
59985 FOR K = 1 TO 6: READ ITEMS1$(K): NEXT K
59987 FOR K = 1 TO 6: READ ITEMS2$(K): NEXT K
59988 FOR K = 1 TO 6: READ TR(K): NEXT K
59989 FOR K = 1 TO 6: READ INV$(K): NEXT K
59990 FOR K = 1 TO 6: READ DES$(K): NEXT K 
59991 REM
59992 RETURN

60000 DATA "passenger cell", "gallows deck", "boiler room", "engine room", "cargo hold"
60010 DATA "elevator", "bridge", "main deck", "boat deck", "lifeboat"
60020 DATA -1,-1,2,-1
60030 DATA 1,-1,3,-1
60040 DATA 2,-1,4,-1
60050 DATA 3,-1,5,-1
60060 DATA 4,-1,6,-1
60070 DATA 5,-1,7,-1
60080 DATA 6,-1,8,-1
60090 DATA 7,-1,9,-1
60100 DATA 8,-1,10,-1
60110 DATA 9,-1,-1,-1
60120 REM ITEMS
60130 REM DATA "WAL","there is a wallet on the table here", 1, "a wallet","the wallet contains 5,000 dollars"
60140 REM DATA "KNI","there is a knife on the table here", 1, "a knife","the knife is very sharp"
60150 REM DATA "GUN", "there is a gun on one of the suitcases here", 5, "a gun","the gun is loaded"
60160 REM DATA "KEY", "there is a key laying on the floor here", 4, "a key","the key is an elevator key"
60170 REM DATA "LIF", "there is a life suit laying on the floor here", 3, "a life suit","the life suit is a life jacket"
60180 REM DATA "UNI", "there are a boat crew uniform laying on the floor here", 3, "a boat crew uniform","the boat crew uniform is a is a formal TITANIC staff uniform"

60200 DATA "WAL", "KNI", "GUN", "KEY", "LIF", "UNI"
60210 DATA "there is a wallet on the table here", "there is a knife on the table here", "there is a gun on one of the suitcases here"
60215 DATA "there is a key laying on the floor here", "there is a life suit laying on the floor here", "there are a boat crew uniform laying on the floor here"
60220 DATA 1,1,5,4,3,3
60230 DATA "a wallet", "a knife", "a gun", "a key", "a life suit", "a boat crew uniform"
60240 DATA "the wallet contains 5,000 dollars", "the knife is very sharp", "the gun is loaded", "the key is an elevator key", "the life suit is a life jacket", "the boat crew uniform is a is a formal TITANIC staff uniform"

Play Online on Archive.org the game TITANIC
#95
gwbasic / GW Basic Game "Mental"
Last post by ron77 - Nov 20, 2023, 03:00 PM
A story in a forum of a game - you play a young man released from a Mental hospital with an Illness and Meds for life - You, your Family, and Your Friends need to adjust and learn to live with what has happened to you. You need to choose how to see yourself as a victim of circumstances or as a person with choice and ability to take responsibility for your life...

The game is three files (MENTAL1.BAS MENTAL2.BAS MENTAL3.BAS) and is attached in a zip folder with all necessary files (text files) to run under DOSBOX with GWBASIC.EXE...

You cannot view this attachment.

MENTAL game emulated to play online on Archive.org
#96
gwbasic / GW Basic Quitting Smoking Prog...
Last post by ron77 - Nov 20, 2023, 02:49 PM
10 REM QUIT SMOKING PROGRAM
20 REM BY RON77 2023
30 REM INITIALIZE VARIABLES
40 LOGFILE$="QUIT.LOG":SWITCHFILE$= "SWITCH.TXT": S$="": ROW=0: QUIT=0: DT$="":D$="": M$="": Y$="": CHOICE=0: FLAG=0: CIGS=0: COST=0: YEARS=0: LIFE=0
45 GOSUB 8000: REM CHECK FOR SWITCH FILE
50 REM MAIN PROGRAM LOOP
60 SCREEN 0: WIDTH 80:KEY OFF: COLOR 15,0: CLS:S$="QUIT SMOKING PROGRAM": ROW=3: GOSUB 5000
70 S$="BY RON77 2023": ROW=4: GOSUB 5000
80 WHILE INKEY$="": WEND
90 CLS
100 S$="QUIT SMOKING PROGRAM": ROW=3: GOSUB 5000
120 IF QUIT = 0 THEN S$="1. I'M READY TO QUIT": ROW=5: GOSUB 5000 :
130 IF QUIT = 1 AND FLAG = 1 THEN S$="1. VIEW DAYS WITHOUT SMOKING": ROW=5: GOSUB 5000
140 IF QUIT = 1 AND FLAG=1 THEN S$="2. VIEW MONEY SAVED": ROW=6: GOSUB 5000
150 IF QUIT = 1 AND FLAG =1 THEN S$="3. VIEW CIGARETTES NOT SMOKED": ROW=7: GOSUB 5000
155 IF QUIT = 1 AND FLAG = 1 THEN S$="4. I STARTED SMOKING AGAIN": ROW=8: GOSUB 5000
160 IF QUIT = 0 THEN S$="2. SMOKING CALCULATOR": ROW=6: GOSUB 5000
170 INPUT "ENTER CHOICE: ", CHOICE
180 IF QUIT = 0 AND CHOICE = 1 THEN GOSUB 1000: CHOICE=0: GOTO 90
190 IF QUIT = 0 AND CHOICE = 2 THEN GOSUB 2000: CHOICE=0 : GOTO 90
200 IF QUIT = 1 AND CHOICE = 1 THEN GOSUB 3000 : CHOICE=0 : GOTO 90
210 IF QUIT = 1 AND CHOICE = 2 THEN GOSUB 4000 : CHOICE=0 : GOTO 90
220 IF QUIT = 1 AND CHOICE = 3 THEN GOSUB 6000: CHOICE=0 : GOTO 90
225 IF QUIT = 1 AND CHOICE = 4 THEN GOSUB 7000 : CHOICE=0 : GOTO 90
230 IF QUIT = 0 AND CHOICE < 1 AND CHOICE < 2 THEN GOTO 170
240 IF QUIT = 1 AND CHOICE < 1 AND CHOICE < 4 THEN GOTO 170
250 GOTO 90

1000 REM QUIT SMOKING ROUTINE
1010 OPEN "A",#1,LOGFILE$
1020 DT$=DATE$
1030 PRINT #1,DT$
1032 PRINT #1, FLAG
1035 IF FLAG = 1 THEN PRINT #1, CIGS, COST, YEARS
1040 CLOSE #1
1050 QUIT=1
1051 OPEN "O",#1,SWITCHFILE$
1052 PRINT #1, QUIT
1053 PRINT #1, FLAG
1054 CLOSE #1
1060 CLS
1070 S$="YOU STARTED QUITTING SMOKING": ROW=3: GOSUB 5000
1080 S$="ON "+DT$: ROW=4: GOSUB 5000
1090 S$="PRESS ANY KEY TO CONTINUE": ROW=6: GOSUB 5000
1100 WHILE INKEY$="": WEND
1110 RETURN

2000 REM SMOKING CALCULATOR ROUTINE
2010 CLS
2015 FLAG=1
2020 S$="SMOKING CALCULATOR": ROW=3: GOSUB 5000
2030 INPUT "HOW MANY CIGARETTES DO YOU SMOKE A DAY? ", CIGS
2040 INPUT "HOW MUCH DOES A PACK OF CIGARETTES COST? ", COST
2050 INPUT "HOW MANY YEARS HAVE YOU BEEN SMOKING? ", YEARS
2060 CIGSYEARS=CIGS*365
2070 CIGSTOTAL=CIGSYEARS*YEARS
2080 COSTTOTAL=COST*(CIGSTOTAL/20)
2082 LIFE = (((CIGSTOTAL*5)/60)/24)/365
2090 CLS:S$="YOU HAVE SPENT $"+MID$(STR$(COSTTOTAL),2)+" ON CIGARETTES": ROW=5: GOSUB 5000
2100 S$="YOU HAVE SMOKED "+MID$(STR$(CIGSTOTAL),2)+" CIGARETTES": ROW=6: GOSUB 5000
2110 S$="YOU HAVE LOST "+MID$(STR$(LIFE),2)+" YEARS OF YOUR LIFE": ROW=7: GOSUB 5000
2120 S$="PRESS ANY KEY TO CONTINUE": ROW=9: GOSUB 5000
2130 WHILE INKEY$="": WEND
2140 RETURN

3000 REM DAYS WITHOUT SMOKING ROUTINE
3010 CLS
3020 OPEN "I",#1,LOGFILE$
3030 INPUT #1, DT$
3032 INPUT #1, FLAG
3035 IF FLAG = 1 THEN INPUT #1, CIGS, COST, YEARS
3040 CLOSE #1
3050 REM CALCULATE DAYS WITHOUT SMOKING
3060 DTP$=DATE$
3061 EM$=MID$(DTP$,1,2)
3062 ED$=MID$(DTP$,4,2)
3063 EY$=MID$(DTP$,7,4)
3064 SM$=MID$(DT$,1,2)
3065 SD$=MID$(DT$,4,2)
3066 SY$=MID$(DT$,7,4)
3070 REM
3080 REM
3090 M = VAL(SM$): D = VAL(SD$): Y = VAL(SY$): GOSUB 3500: SJ = JDN
3100 M = VAL(EM$): D = VAL(ED$): Y = VAL(EY$): GOSUB 3500: EJ = JDN
3110 DD = EJ - SJ
3120 S$="NUMBER OF DAYS: "+MID$(STR$(DD),2): ROW=5: GOSUB 5000
3125 WHILE INKEY$="": WEND
3130 RETURN

3500 REM SUBROUTINE TO CONVERT DATE TO JULIAN DAY NUMBER
3510 REM
3520 A = (14 - M) / 12
3530 Y = Y + 4800 - A
3540 M = M + 12 * A - 3
3560 JDN = D + ((153 * M + 2) / 5) + 365 * Y + Y / 4 - Y / 100 + Y / 400 - 32045
3570 RETURN

4000 REM MONEY SAVED ROUTINE
4010 CLS
4020 OPEN "I",#1,LOGFILE$
4030 INPUT #1, DT$
4032 INPUT #1, FLAG
4035 IF FLAG = 1 THEN INPUT #1, CIGS, COST, YEARS
4040 CLOSE #1
4050 REM CALCULATE MONEY SAVED
4060 DTP$=DATE$
4061 EM$=MID$(DTP$,1,2)
4062 ED$=MID$(DTP$,4,2)
4063 EY$=MID$(DTP$,7,4)
4064 SM$=MID$(DT$,1,2)
4065 SD$=MID$(DT$,4,2)
4066 SY$=MID$(DT$,7,4)
4070 REM
4080 REM
4090 M = VAL(SM$): D = VAL(SD$): Y = VAL(SY$): GOSUB 3500: SJ = JDN
4100 M = VAL(EM$): D = VAL(ED$): Y = VAL(EY$): GOSUB 3500: EJ = JDN
4110 DD = EJ - SJ
4120 CIGARETTES = DD * CIGS
4130 MONEY = CIGARETTES * COST / 20
4140 S$="MONEY SAVED: $"+MID$(STR$(MONEY),2) : ROW=5: GOSUB 5000
4145 WHILE INKEY$="": WEND
4150 RETURN


5000 REM CENTER PRINT ROUTINE
5010 LOCATE ROW,(80-LEN(S$))/2: PRINT S$
5020 RETURN

6000 REM CIGARETTES NOT SMOKED ROUTINE
6010 CLS
6020 OPEN "I",#1,LOGFILE$
6030 INPUT #1, DT$
6032 INPUT #1, FLAG
6035 IF FLAG = 1 THEN INPUT #1, CIGS, COST, YEARS
6040 CLOSE #1
6050 REM CALCULATE CIGARETTES NOT SMOKED
6060 DTP$=DATE$
6061 EM$=MID$(DTP$,1,2)
6062 ED$=MID$(DTP$,4,2)
6063 EY$=MID$(DTP$,7,4)
6064 SM$=MID$(DT$,1,2)
6065 SD$=MID$(DT$,4,2)
6066 SY$=MID$(DT$,7,4)
6070 REM
6080 REM
6090 M = VAL(SM$): D = VAL(SD$): Y = VAL(SY$): GOSUB 3500: SJ = JDN
6100 M = VAL(EM$): D = VAL(ED$): Y = VAL(EY$): GOSUB 3500: EJ = JDN
6110 DD = EJ - SJ
6120 CIGARETTES = DD * CIGS
6130 S$="CIGARETTES NOT SMOKED: "+MID$(STR$(CIGARETTES),2): ROW=5: GOSUB 5000
6135 WHILE INKEY$="": WEND
6140 RETURN

7000 REM STARTED SMOKING AGAIN ROUTINE
7010 CLS
7011 PRINT "ARE YOU SURE YOU WANT TO START SMOKING AGAIN? (Y/N)"
7012 INPUT, S$
7013 IF START$ = "N" OR START$="n" THEN RETURN
7015 FLAG=0: QUIT=0
7020 KILL LOGFILE$
7025 OPEN "O",#1,SWITCHFILE$
7026 PRINT #1, QUIT
7027 PRINT #1, FLAG
7030 CLOSE #1
7040 RETURN

8000 REM CHECK FOR SWITCH FILE
8010 OPEN "I",#1,SWITCHFILE$
8020 INPUT #1, QUIT
8025 INPUT #1, FLAG
8030 CLOSE #1
8040 RETURN

file "SWITCH.TXT" content
0
0
#97
gwbasic / Gw Basic Game - Russian Roulet...
Last post by ron77 - Nov 20, 2023, 02:41 PM
10 REM RUSSIAN ROULETTE GAME IN GW BASIC
20 REM BY RON77 (SOLO88) 2023
30 REM INITIALIZE VARIABLES
40 DIM GUN(6): USER1$="": USER2$="": S$="": ROW=0: RANDOMIZE TIMER: B=0
50 FOR I = 1 TO 6: GUN(I) = 0: NEXT I
60 REM INTRO
65 GOSUB 1200 REM SCREEN 0: REM COLOR 15,0:REM CLS
70 S$ = "RUSSIAN ROULETTE": ROW = 3: GOSUB 1000
80 S$ = "BY RON77 (SOLO88)": ROW = 5: GOSUB 1000
90 WHILE INKEY$ = "": WEND: BEEP
100 GOSUB 1300
110 S$="RUSSIAN ROULETTE": ROW=3: GOSUB 1000
120 S$="BY RON77 (SOLO88)": ROW=5: GOSUB 1000
130 WHILE INKEY$="": WEND: GOSUB 1200
140 REM START OG GAME LOOP
150 INPUT "PLAYER 1 NAME: ", USER1$
160 INPUT "PLAYER 2 NAME: ", USER2$
170 CLS
180 PRINT USER$;"ONE OR TWO BULLETS IN THE REVOLVER?"
190 INPUT "ENTER 1 OR 2: ", BULLETS
200 IF BULLETS = 1 THEN GOTO 220 ELSE IF BULLETS = 2 THEN GOTO 230

220 REM ONE BULLET IN THE REVOLVER
221 GUN(3) = 1
222 GOTO 240

230 REM TWO BULLETS IN THE REVOLVER
231 GUN(3) = 1: GUN(6) = 1
232 GOTO 240

240 REM START OF GAME LOOP
250 REM PLAYER 1 TURN
255 GOSUB 1200: PRINT USER1$;" TURN"
260 PRINT "1, ROLL THE CYLINDER"
270 PRINT "2, PULL THE TRIGGER"
280 PRINT "3, QUIT"
290 INPUT "ENTER 1, 2, OR 3: ", CHOICE
295 IF CHOICE < 1 OR CHOICE > 3 THEN GOTO 290
300 ON CHOICE GOTO 400, 500, 600

320 REM PLAYER 2 TURN
325 GOSUB 1200: PRINT USER2$;" TURN"
330 PRINT "1, ROLL THE CYLINDER"
340 PRINT "2, PULL THE TRIGGER"
350 PRINT "3, QUIT"
360 INPUT "ENTER 1, 2, OR 3: ", CHOICE
365 IF CHOICE < 1 OR CHOICE > 3 THEN GOTO 360
370 ON CHOICE GOTO 450, 550, 650

400 REM ROLL THE CYLINDER PLATER 1
415 FOR I = 1 TO 6
420 B = INT(RND*7)
422 NEXT I
425 GOSUB 50600
430 GOTO 240

450 REM ROLL THE CYLINDER PLAYER 2
455 FOR I = 1 TO 6
460 B = INT(RND*7)
462 NEXT I
465 GOSUB 50600
470 GOTO 320


500 REM PULL THE TRIGGER PLATER 1
505 IF GUN(B) = 1 THEN GOSUB 1300: BEEP: ROW=4:S$=USER1$+" YOU DIED!":GOSUB 1000: END
510 IF GUN(B) = 0 THEN GOSUB 1200: BEEP: ROW=4:S$=USER1$+" YOU LIVE!":GOSUB 1000: T!=TIMER +3:WHILE TIMER <T!:WEND:GOTO 320

550 REM PULL THE TRIGGER PLAYER 2
555 IF GUN(B) = 1 THEN GOSUB 1300: BEEP: ROW=4:S$=USER2$+" YOU DIED!":GOSUB 1000: END
560 IF GUN(B) = 0 THEN GOSUB 1200: BEEP: ROW=4:S$=USER2$+" YOU LIVE!":GOSUB 1000: T!=TIMER +3:WHILE TIMER <T!:WEND: GOTO 240

600 REM QUIT PLAYER 1
605 GOSUB 1200: ROW=4:S$=USER1$+" QUIT!":GOSUB 1000: END

650 REM QUIT PLAYER 2
655 GOSUB 1200: ROW=4:S$=USER2$+" QUIT!":GOSUB 1000: END

1000 REM PRINT STRING
1010 LOCATE ROW, (80 - LEN(S$))/2: PRINT S$
1020 RETURN

1200 REM SCREEN INIT
1210 SCREEN 0: COLOR 15,0: CLS
1220 RETURN

1300 REM SCREEN RED COLOR
1310 SCREEN 0: COLOR 4,0: CLS
1320 RETURN

50600 FOR I = 1 TO 50
50700    J=RND(I)*10000
50800    IF J<37 THEN 51100
50900    PLAY "mb"
51000    SOUND J,.5
51100 NEXT I
51200 RETURN
#98
gwbasic / GW Basic Chatbot - Aviv-Bot
Last post by ron77 - Nov 20, 2023, 02:36 PM
10 REM A CHATBOT AVIV-BOT
20 REM BY RON77
30 REM 2023
40 REM PROGRAM INITIALIZATION
50 DIM K$(100),R$(100, 5),D$(20): DCOUNT=0:FLINE$="":TAG$="":STEXT$="":TAGP=0:KNUM=0
60 PRINT "        LOADING DATABASE PLEASE WAIT..."
70 DATAFILE$="DATABASE.DAT": RANDOMIZE TIMER
80 REM LOAD DATABASE
82 KEYWORDNUM = 1: REPLYNUM = 1
90 OPEN "I",#1,DATAFILE$
100 WHILE NOT EOF(1)
110 LINE INPUT #1,FLINE$
120 IF LEN(FLINE$)>0 THEN TAGP = INSTR(FLINE$,":")
130 IF TAGP>0 THEN TAG$=LEFT$(FLINE$,1) : STEXT$=MID$(FLINE$,TAGP+1) ELSE TAG$=""
140 IF TAG$="k" THEN K$(KEYWORDNUM)=" "+ STEXT$+ " ": REPLYNUM = 1: KEYWORDNUM=KEYWORDNUM+1
150 IF TAG$="r" THEN R$(KEYWORDNUM - 1, REPLYNUM)=STEXT$: REPLYNUM=REPLYNUM+1
160 IF TAG$="d" THEN D$(DCOUNT)=STEXT$: DCOUNT=DCOUNT+1
170 WEND
180 CLOSE #1
181 C = 0
182 SCREEN 0: WIDTH 80:KEY OFF:COLOR 15,C: CLS
183 PRINT "                     === AVIV-CHATBOT VERSION 0.1 ==="
184 PRINT "                            === BY RON77 ==="
185 PRINT "                               === 2023 ==="
186 PRINT "       TYPE goodbye TO EXIT use lowercase only and no question marks"
187 COLOR 0,7:LOCATE 25,1:PRINT SPACE$(80);:LOCATE 25,1:PRINT "CHATBOT AVIV VERSION 0.1 BY RON77 2023";:LOCATE 5,1:COLOR 15,C
190 REM MAIN LOOP
191 C=C+1:IF C>15 THEN C=1
200 COLOR ,C:PRINT 
210 INPUT "YOU: ", USERINPUT$
211 USERINPUT$ = " " + USERINPUT$ + " "
220 IF USERINPUT$ = " goodbye " THEN GOTO 500
230 KFOUND = 0
240 FOR I = 1 TO KEYWORDNUM - 1
250   IF INSTR(USERINPUT$,K$(I)) > 0 THEN KFOUND = 1: KNUM = I: GOTO 300
260 NEXT I
270 IF KFOUND = 0 THEN GOTO 400
271 REM
280 GOTO 190

300 REM KEYWORD FOUND, SELECT A RANDOM REPLY
310 RNUM = INT(RND * 5) + 1
320 COLOR ,C:PRINT "AVIV-BOT: " + R$(KNUM, RNUM)
390 GOTO 260

400 REM KEYWORD NOT FOUND, USE DEFAULT REPLY
410 DNUM = INT(RND * DCOUNT)
420 PRINT "AVIV-BOT: " + D$(DNUM)
430 GOTO 190

500 REM EXIT
510 PRINT "AVIV-BOT: GOODBYE!"
520 END

DATABASE.DAT file example:
================== aviv database ==================
========= database rule - one keyword to five responses up to 100 keywords total =========
k:hi

r:hi long time not seen you
r:hi how are you?
r:hi how are you doing?
r:boy i sure missed you and i'm not being cynical
r:hi how are you doing? i missed you

k:how are you

r:i'm fine thank you
r:i'm fine thank you and you?
r:i'm alive and well but what about you?
r:well i still got the old records we used to listen to
r:don't worry i haven't forgotten you my friend



=============default replies===================

d:go on i'm listening to you man
d:i feel you man
d:you're so funny
d:i think understand what your saying
d:why is that?
d:if you wish we can talk on something else
d:i missed talking to you did i tell you that :)
d:why don't you put some music on or chill with something else
d:we don't have to talk about it if you don't want to or can't
d:god i miss jerusalem with all of you guys
d:so you made me as a chatbot hum? you need some friends
d:well people all people can be mean sometimes but you have to be strong and not let them get to you
d:how are you really?
d:would you like open it up to me?
d:so another chatbot hum? when will you have a girlfriend?
d:look i know life is unfair and the world is cruel but you have to be strong and not let it get to you
d:i'm here for you and i'll try to listen and understand and support you in any way i can
d:what makes you say that?
d:did i ever tell you how awesome i think you are? :D

chatbot aviv on archive.org emulated
#100
General Discussion / Re: what kind of music do you ...
Last post by johnno56 - Nov 19, 2023, 08:55 PM
Swedish... I think the closest I ever got to 'Swedish' was a couple of Abba hits... Not a fan of 'techno'...