BASIC was the first and only computer language I learned to code! I really loved it, but my parents discouraged it because there was no future in writing computer code. Riiiight.
Odysseyroc, this is wonderful. I particularly love that the subtle reference to the Blue Screen of Death! Nice choice of color.
Takes me back to programming a casino game in BASIC back in the day. Just RND abuse, nothing fancy. But the best part was the splash screen with the system speaker beeping a crude version of The Gambler. I peaked at 12 years old.
CLS
10 PRINT āWelcome to my guessing game! I bet you canāt guess the number Iām thinking of! Itās between 1 and 10!ā
20 RANDOMIZE TIMER
x% = INT(RND * 10) + 1
30 INPUT āWhat is your guess >ā, guess%
IF guess% > x% THEN GOTO 40
IF guess% < x% THEN GOTO 50
IF guess% = x% THEN GOTO 60
40 PRINT āNope! Thatās too high!ā
GOTO 30
50 PRINT āNope! Thatās too low!ā
GOTO 30
60 PRINT āUhhhhh. Thatās not right. Uhhhh, hold on a secondā¦ā
GOTO 20
I have like 3 or 4 of them. And a large box of assorted controllers. And probably around a couple hundred disks. And an X1541 adapter cable (to connect the 1541 drive to a PC parallel port).
And a bunch of other misc stuff.
Havenāt used the stuff in years, but itās nice knowing itās there.
Used to play around with the emulators a bit, but havenāt done that for years either.
I only know it because I learned it three weeks ago in my computer science class.
Yeah, when doing upper level java stuff/black magic, and prof just throws it on the board.
I was all like, āfamous Mystery Dog sound.ā
Iām still trying to figure out whats wrong with playing it as is? The only thing Iād change is all the GOTO commands after each possible result would go back to 20 instead of 30. Adds more challenge to never satisfying your computer. If it drives one person mad, Iāve done my job.
CLS
10 PRINT āWelcome to my guessing game! I bet you canāt guess the number Iām thinking of! Itās between 1 and 10!ā
20 RANDOMIZE TIMER
24 REM x% = (RND * 10) + 1 25 x% = int(rnd(0) * 10) + 1
30 INPUT āWhat is your guess >ā, guess%
31 REM IF guess@ > x% THEN GOTO 40 32 if guess% > x% then goto 40
33 REM IF guess@ < x% THEN GOTO 50 34 if guess% < x% then goto 50
35 REM IF guess@ = x% THEN GOTO 60 36 goto 60
40 PRINT āNope! Thatās too high!ā
41 REM goto 30 45 goto 30
49 REM 50 PRINT āNope!ā Thatās too low!" 50 print āNope! Thatās too low!ā
51 REM GOTO 30 55 goto 30
60 PRINT āUhhhhh. Thatās not right. Uhhhh, hold on a secondā¦ā 70 print āokay, you got me. Letās go again!ā
79 REM GOTO 20 80 goto 25
Why havenāt I forgotten this stuff already? Itās been like 35 years since I looked at a Basic programā¦
You donāt need the third IF statement. In the interests of speeding up the program that should just be a straight GOTO.
In what BASIC can you randomize the RND function by calling it? My understanding is that RANDOMIZE N does the randomizing, and the parameter to RND is optional or ignored.
Too young to have ever written anything in basic, but i have learned a lot from my dad who was one of few who knew Cobalt in the north east, at the time when cobalt started being used in business.
This is a cool idea. However, shirtwoot has been on a bit of a nerd bender lately. We all need to think about The Raven and The Binge, shirts that speak to the lit majors and the kids a bit too.