Jump to content

16 puzzle game: Difference between revisions

m
→‎{{header|REXX}}: corrected misspellings.
m (→‎{{header|REXX}}: corrected a misspelling.)
m (→‎{{header|REXX}}: corrected misspellings.)
Line 29:
if N<2 | N>9 then do; say sep er "grid size is out of range: " N; exit 1; end
if isInt(seed) then call random , , seed /*use repeatability seed for RANDOM BIF*/
say sep 'Playing a ' N*N " game with a difficulitydifficulty level of: " hard
#=0
do r=1 for N /* [◄] build a solution for testing. */
Line 35:
end /*c*/
end /*r*/
/* [↓] HARD is the puzzle difficulitydifficulty.*/
do hard; row= random(1) /*scramble the grid HARD # of times.*/
if row then call move random(1,N)substr('LR', random(1, 2), 1) /* ◄── move row. */
Line 99:
do c=1 for N; z= z || right(@.r.c, 2)'║' /*build row by row. */
end /*c*/
z= z ' ' r"L" /*add rightsideright-side info.*/
if r==1 then z= z pad'L means shift a row left' /* " 1st help info.*/
if r==2 then z= z pad'R means shift a row right' /* " 2nd " " */
Line 109:
{{out|output|text=&nbsp; when using the default inputs:}}
<pre>
──────── Playing a 16 game with a difficulitydifficulty level of: 2
 
a- b- c- d- - means shift a column down
Cookies help us deliver our services. By using our services, you agree to our use of cookies.