15 puzzle game in 3D: Difference between revisions

Content added Content deleted
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.
<lang go>package main
<syntaxhighlight lang=go>package main


import (
import (
Line 168: Line 168:


rl.CloseWindow()
rl.CloseWindow()
}</lang>
}</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].
<!--<lang Phix>(phixonline)-->
<!--<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>
<!--</lang>-->
<!--</syntaxhighlight>-->


=={{header|Ring}}==
=={{header|Ring}}==
<lang 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.
<lang ecmascript>import "dome" for Window
<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()</lang>
var Game = FifteenPuzzle3d.new()</syntaxhighlight>