QB64 Phoenix Edition
Stars! (Remake of Atari BASIC game) - Printable Version

+- QB64 Phoenix Edition (https://staging.qb64phoenix.com)
+-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1)
+--- Forum: Prolific Programmers (https://staging.qb64phoenix.com/forumdisplay.php?fid=26)
+---- Forum: SMcNeill (https://staging.qb64phoenix.com/forumdisplay.php?fid=29)
+---- Thread: Stars! (Remake of Atari BASIC game) (/showthread.php?tid=375)



Stars! (Remake of Atari BASIC game) - SMcNeill - 05-08-2022

Remade from an old game which I found in a magazine sitting dusty back on my shelves.  

Code: (Select All)
Randomize Timer


start:
Cls
Color 7
Print "Welcome to STARS -- a remake of an Atari-BASIC game from the 80s!"
Print
Print "The rules are simple:  I'm going to generate a number from 1 to 100, and you    "
Print "have to guess it."
Print
Print "You have 7 tries to guess my number, and I'll offer you feedback in the form of     "
Print "stars (*), depending on how close you are to my number."
Print
Print "If you're really close, I'll give you 7 stars (*******)."
Print "If you're really off from my number, I'll give you 1 star (*)."
Print "The more stars I give you, the closer you are to guessing my number!"
Print
Color 4
Print "Are you ready to begin? (Yes/Quit)"
Do
    a$ = UCase$(Input$(1))
    If a$ = "Q" Then System
Loop Until a$ = "Y"

num = Int(Rnd * 100) + 1
For i = 1 To 7
    Color 7
    Print "Give me your guess #"; i; "=>";
    Input ; guess
    Color 4
    Select Case Abs(num - guess)
        Case Is >= 64: Print "*"
        Case Is >= 32: Print "**"
        Case Is >= 16: Print "***"
        Case Is >= 8: Print "****"
        Case Is >= 4: Print "*****"
        Case Is >= 2: Print "******"
        Case Is = 1: Print "*******"
        Case Is = 0
            Print "You got it in "; i; "guesses!"
            GoTo endchoice
    End Select
    Color 7
Next
Print "You failed to guess my number!  It was "; num

endchoice:
Print
Color 4
Print "Press <Any Key> to restart"
_Delay 1
_KeyClear
Sleep
Color 7
GoTo start

Try to play without reading the source first.  Once you read the source and know *exactly* what those stars represent, all the challenge goes out of the game.  Tongue