Commits

ChrisLowe committed 950923a

Fixed bug by clearing input buffer each round

Comments (0)

Files changed (1)

 ADD [seed], [last_guess]   ;; update seed
 ADD [seed], [random_number]
 SET [guess_count], 0
+JSR clean_guess_input
 SET PC, new_game
 
 
 
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;     Clean guess input
+;;
+:clean_guess_input
+SET A, guess_input
+:clean_guess_input_loop
+IFE [A], 0x20
+SET [A], 0
+IFE [A], 0xFFFE   ;magic number deliminator
+SET PC, POP
+SET [A], 0
+ADD A, 1
+SET PC, clean_guess_input_loop
+
+
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
 ;;      Ask the user for their next guess
 DAT 0, 0, 0
 
 :guess_input
-DAT 0, 0, 0
+DAT 0, 0, 0, 0xFFFE   ;magic number to help clearing
 
 :last_guess
 DAT 0