Knight's tour: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
m (ANSI Standard BASIC and BBC BASIC moved to the BASIC section.)
m (→‎{{header|Wren}}: Changed to Wren S/H)
(2 intermediate revisions by 2 users not shown)
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}}===
Line 4,418 ⟶ 4,416:
=={{header|Fōrmulæ}}==
 
{{FormulaeEntry|page=https://formulae.org/?script=examples/Knight%27s_tour}}
Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text. Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation &mdash;i.e. XML, JSON&mdash; they are intended for storage and transfer purposes more than visualization and edition.
 
Programs in Fōrmulæ are created/edited online in its [https://formulae.org website], However they run on execution servers. By default remote servers are used, but they are limited in memory and processing power, since they are intended for demonstration and casual use. A local server can be downloaded and installed, it has no limitations (it runs in your own computer). Because of that, example programs can be fully visualized and edited, but some of them will not run if they require a moderate or heavy computation/memory resources, and no local server is being used.
 
In '''[https://formulae.org/?example=Knight%27s_tour this]''' page you can see the program(s) related to this task and their results.
 
=={{header|Fortran}}==
Line 11,531 ⟶ 11,525:
=={{header|Wren}}==
{{trans|Kotlin}}
<syntaxhighlight lang="ecmascriptwren">class Square {
construct new(x, y) {
_x = x
9,476

edits