So, new issue.
I attempted to fix another problem, and when that just caused issues i reinstalled the program
But now, I have a new issue.
When i try and run the below program what i get is a flash of black on the screen like it ran but then it just goes back to my code.
No syntax errors are reported, nothing.
Just a flash and its over.
If i try and run something like
Print \"Weeeeeeeeeeeeee\"
Wait key
End
No problem, but the below just gives me a flash of black then ends.
Any ideas how to fix this?
(here is the code that refuses to run)
Wait key `Test thing
#CONSTANT screenwidth = 800
#CONSTANT screenheight = 600
#CONSTANT fontname = “Courier New”
#CONSTANT fontsize = 30
#CONSTANT fontcolour = RGB(255,255,255)
Set Display Mode screenwidth, screenheight, 16
randomize timer()
REM *** Global variables ***
GLOBAL word$
GLOBAL guess$ `player’s guess
GLOBAL wrongguesses `number of wrong guesses made
GLOBAL correctletters `number of letters in word$ that have been guessed
REM *** Main program ***
InitialiseGame() `Set display and globals
Random = rnd(3) +1
ThinkOfWord(Random) `Think of word
print word$
DrawInitialScreen() `Draw start-up screen
REPEAT
GetGuess() `Get player’s guess
letterfound = CheckForLetter() `Check if letter in word
print letterfound
IF letterfound = 1
DrawLetter() `Add letter at each point
ELSE
AddToHangedMan() `Add section to hanged man
ENDIF
UNTIL WordGuessed() OR HangedManComplete()
Print WordGuessed()
Print HangedManComplete()
GameOver() `Game Over message
WAIT KEY
END
Function InitialiseGame()
set text size 40
set text font \"Ariel\"
set cursor 270, 240
print \"Time for Hangman\"
Wait key
set text size fontsize
cls
endfunction
Function ThinkOfWord(Random)
Data \"You\", \"are\", \"an\", \"Asshat\"
for c = 1 to random
read word$
next c
Endfunction
Function DrawInitialScreen()
DrawGallows()
Endfunction
Function GetGuess()
Print \"Input from player\"
Endfunction
Function CheckForLetter()
x = 1
Print \"Check if letter is in word, return letter if correct\"
endfunction x
function DrawLetter()
print \"Draw letter onto space if correct\"
endfunction
Function AddToHangedMan()
Print \"If incorrect guess add to the hanged man\"
endfunction
Function Wordguessed()
y = 1
Print \"Word is guessed before death\"
Endfunction y
Function HangedManComplete
z = 1
Print \"Hanged man dies first...\"
Endfunction z
Function GameOver()
Print \"Game Over screen\"
Endfunction
Function DrawGallows()
CLS RGB (100, 100, 100)
Ink rgb (100, 200, 200), rgb (100, 100, 100)
Line 75, 300 , 75, 50
line 75, 50, 200, 50
line 200, 50, 200, 100
c1 = RGB (RND(255), RND(255), RND(255))
c2 = RGB (RND(255), RND(255), RND(255))
c3 = RGB (RND(255), RND(255), RND(255))
c4 = RGB (RND(255), RND(255), RND(255))
x1 = 25
y1 = 300
x2 = 250
y2 = 325
box x1,y1,x2,y2,c1,c2,c3,c4
wait key
ink point (x1, y1), 0
print \"top left\"
wait key
Set cursor 45,20
ink point (x2-1, y2-1), 0
print \"Bottom right\"
wait key
Set cursor 120,0
ink point (x1, y2-1), 0
print \"bottom left\"
wait key
Set cursor 190,20
ink point (x2-1, y1), 0
print \"top right\"
endfunction
Winning an argument against a troll, whom must admit that you are correct. The creature then kills itself in complete shame. Everything in world is a lil better.
That's how finishing a code feels.