15 puzzle game in 3D: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
m (Automated syntax highlighting fixup (second round - minor fixes))
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
<syntaxhighlight lang="go">package main


import (
import (
Line 173: Line 173:
{{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)-->
<!--<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 733: Line 733:


=={{header|Ring}}==
=={{header|Ring}}==
<syntaxhighlight lang=ring>
<syntaxhighlight lang="ring">
/*
/*
## Project : 15 Puzzle Game in 3D
## Project : 15 Puzzle Game in 3D
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
<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