Knight's tour: Difference between revisions

→‎{{header|ANSI Standard BASIC}}: Changed to {{header|ANSI BASIC}}; {{works with|Decimal BASIC}}.
m (ANSI Standard BASIC and BBC BASIC moved to the BASIC section.)
(→‎{{header|ANSI Standard BASIC}}: Changed to {{header|ANSI BASIC}}; {{works with|Decimal BASIC}}.)
Line 1,949:
 
=={{header|BASIC}}==
==={{header|ANSI Standard BASIC}}===
{{trans|BBC BASIC}}
[[File:Knights_Tour.gif|right]]
{{works with|Decimal BASIC}}
 
ANSI BASIC doesn'tdoes not allow function parameters to be passed by reference, so X and Y were made global variables.
<syntaxhighlight lang="ansi standard basic">100 DECLARE EXTERNAL FUNCTION choosemove
 
<syntaxhighlight lang="ansi standard basic">100 DECLARE EXTERNAL FUNCTION choosemove
110 !
120 RANDOMIZE
Line 2,030 ⟶ 2,029:
830 IF Board(X,Y)=FALSE THEN LET validmove = TRUE
840 END FUNCTION</syntaxhighlight>
 
 
==={{header|BBC BASIC}}===
512

edits