-DECLARE SUB delay (seconds AS SINGLE)\r
-DECLARE SUB drawGridCell (x%, y%)\r
-DECLARE SUB clearTail (playerNumber%)\r
-DECLARE SUB start ()\r
-DECLARE SUB stuff ()\r
-DECLARE SUB stat ()\r
-\r
' Game of worms.\r
'\r
' Game supports up to 5 players. Any amount of those players can be AI controlled.\r
\r
' Changelog:\r
' 2002, Initial version\r
-' 2024, Improved program readability using AI\r
+' 2024-2005, Improved program readability\r
\r
DECLARE FUNCTION cnum$ (a%)\r
DECLARE SUB putworm (a%)\r
END IF\r
END SUB\r
\r
-' This subroutine takes care of clearing out worm tail.\r
-' As form head advances forword in each frame, this procedure\r
-' is responsible for clearing out squares where worm tail moved out\r
-' of. Such squares are marked as empty (no longer occupied by worm)\r
-' and also correspondingly are erased from the screen.\r
SUB clearTail (playerNumber)\r
-\r
+ ' This subroutine takes care of clearing out worm tail.\r
+ ' As worm head advances forward in each frame, this procedure\r
+ ' is responsible for clearing out squares where worm tail moved out\r
+ ' of. Such squares are marked as empty (no longer occupied by worm)\r
+ ' and also correspondingly are erased from the screen.\r
a = ussp(playerNumber) - ussl(playerNumber)\r
\r
IF a < 1 THEN\r
putworm a\r
END SUB\r
\r
-' Since QBasic does not have precise timer suitable for delaying animations,\r
-' workaround here is to use SOUND function. Inaudible sound with frequency\r
-' of 0 Hz is produced. Second argument for SOUND function is sound duration\r
-' that is approximately 1/18'th of the second.\r
SUB delay (delayInSeconds AS SINGLE)\r
-\r
-SOUND 0, delayInSeconds * 18\r
-\r
+ ' Since QBasic does not have precise timer suitable for delaying animations,\r
+ ' workaround here is to use SOUND function. Inaudible sound with frequency\r
+ ' of 0 Hz is produced. Second argument for SOUND function is sound duration\r
+ ' that is approximately 1/18'th of the second.\r
+ SOUND 0, delayInSeconds * 18\r
END SUB\r
\r
SUB drawGridCell (x%, y%)\r
prc a\r
NEXT a\r
END SUB\r
-\r