Hi All,
Just received my DGS in the mail. Note I have never programed anything before, so don't laugh at my code.
Anyways, I tried to write a simple program. It will compile and run, but wont do what it is suppose to do. All the stuff I've been reading, it looks like it ought to run. As you can see, I don't even know what I don't know. So could you guys look this over and educate me a little? I think I am lacking some basic understanding of what going on! I am having at it, and really enjoying learning to write code!
Thanks in advanced for any help.
Mike
SET DISPLAY MODE 640,480,16
REM Set the background color to grey
CLS RGB(120,120,120)
REM Set the font color to white on blue
INK RGB(255,255,255), RGB(0,0,255)
Randomize Timer()
Print rem put this here for spacing
Print "This is a firing simulator for the US Army's 75mmL38 Tank Gun."
Print
InPut "What is the range to target in meters? ";Range
Print
InPut "What is the gunners rating? (Scale 1-10) ";Rating
Print
InPut "How many Rounds will you fire? (1-1000) ";Shots
ToHit= 100
Dice=1
RoundCount=0
Hits=0
Start:
Do
If (rating+Dice+Rnd(99))-(range/100) >= ToHit
Inc Hits
Inc RoundCount
Ratio#= Hits/RoundCount
If RoundCount <= Shots
GoTo Start:
Else
Print "You fired ";RoundCount;" rounds."
Print
Print "You hit the target ";Hits;" times."
Print
Print "For accuracy percentage of ";ratio#;" ."
Print
Print "Hit any key to Exit"
Wait Key
End
EndIf
EndIf
Loop
End
some cool stuff someone else said here