15 puzzle game in 3D: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
|||
Line 19: | Line 19: | ||
The game is controlled by the arrow keys (mouse movement is not supported) which move the white cube left, right, up or down exchanging positions with the colored cube already occupying that position. The number of moves is continually updated and, if the player is eventually successful in assembling the cubes in order, an appropriate message is displayed, the white cube changes to dark green and displays the number 16. |
The game is controlled by the arrow keys (mouse movement is not supported) which move the white cube left, right, up or down exchanging positions with the colored cube already occupying that position. The number of moves is continually updated and, if the player is eventually successful in assembling the cubes in order, an appropriate message is displayed, the white cube changes to dark green and displays the number 16. |
||
< |
<syntaxhighlight lang=go>package main |
||
import ( |
import ( |
||
Line 168: | Line 168: | ||
rl.CloseWindow() |
rl.CloseWindow() |
||
}</ |
}</syntaxhighlight> |
||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
{{libheader|Phix/online}} |
{{libheader|Phix/online}} |
||
You can run this online [http://phix.x10.mx/p2js/153D.htm here]. |
You can run this online [http://phix.x10.mx/p2js/153D.htm here]. |
||
<!--< |
<!--<syntaxhighlight lang=Phix>(phixonline)--> |
||
<span style="color: #000080;font-style:italic;">-- |
<span style="color: #000080;font-style:italic;">-- |
||
-- demo\rosetta\15_puzzle_game_in_3D.exw |
-- demo\rosetta\15_puzzle_game_in_3D.exw |
||
Line 730: | Line 730: | ||
<span style="color: #000000;">main</span><span style="color: #0000FF;">()</span> |
<span style="color: #000000;">main</span><span style="color: #0000FF;">()</span> |
||
<!--</ |
<!--</syntaxhighlight>--> |
||
=={{header|Ring}}== |
=={{header|Ring}}== |
||
< |
<syntaxhighlight lang=ring> |
||
/* |
/* |
||
## Project : 15 Puzzle Game in 3D |
## Project : 15 Puzzle Game in 3D |
||
Line 1,182: | Line 1,182: | ||
func CloseEvent |
func CloseEvent |
||
exit # Exit from the Events Loop |
exit # Exit from the Events Loop |
||
</syntaxhighlight> |
|||
</lang> |
|||
=={{header|Wren}}== |
=={{header|Wren}}== |
||
Line 1,190: | Line 1,190: | ||
{{libheader|Go-fonts}} |
{{libheader|Go-fonts}} |
||
The palette is somewhat different from the Go example and, if the player is eventually successful in assembling the cubes in order, the white cube changes to gold and displays the number 16. |
The palette is somewhat different from the Go example and, if the player is eventually successful in assembling the cubes in order, the white cube changes to gold and displays the number 16. |
||
< |
<syntaxhighlight lang=ecmascript>import "dome" for Window |
||
import "graphics" for Canvas, Color, Font |
import "graphics" for Canvas, Color, Font |
||
import "input" for Keyboard |
import "input" for Keyboard |
||
Line 1,327: | Line 1,327: | ||
} |
} |
||
var Game = FifteenPuzzle3d.new()</ |
var Game = FifteenPuzzle3d.new()</syntaxhighlight> |