Morpion solitaire: Difference between revisions
Content added Content deleted
m (→{{header|J}}) |
m (→{{header|REXX}}: added a link to the LINESIZE.REX program.) |
||
Line 561: | Line 561: | ||
oFID=oFID'.LOG' /*fulltype for the LOG's filename*/ |
oFID=oFID'.LOG' /*fulltype for the LOG's filename*/ |
||
prompt='enter X,Y point and an optional character for placing on board', |
prompt='enter X,Y point and an optional character for placing on board', |
||
'(or Quit):'; prompt=right(prompt, |
'(or Quit):'; prompt=right(prompt,sw,'─') /*right justify it.*/ |
||
call GreekCross |
call GreekCross |
||
jshots=Gshots |
jshots=Gshots |
||
Line 654: | Line 654: | ||
end /*y*/ |
end /*y*/ |
||
if wins==0 then call t copies('═', |
if wins==0 then call t copies('═',sw) |
||
else call t right('count of (above) wins =' wins, |
else call t right('count of (above) wins =' wins,sw,'═') |
||
call t |
call t |
||
return |
return |
||
Line 729: | Line 729: | ||
x=xx |
x=xx |
||
do y=yy-1 by -1; x=x+1; if @.x.y==empty then leave; z=z||@.x.y; end |
do y=yy-1 by -1; x=x+1; if @.x.y==empty then leave; z=z||@.x.y; end |
||
return eureka+countAline(z) /*───────count diag wins: up&<, down&> */ |
return eureka+countAline(z) /*───────count diag wins: up&<, down&> */</lang> |
||
This REXX program makes use of '''LINESIZE''' REXX program (or BIF) which is used to determine the screen width (or linesize) of the terminal (console). |
|||
<br>The '''LINESIZE.REX''' REXX program is included here ──► [[LINESIZE.REX]].<br> |
|||
</lang> |
|||
'''output''' when running 1,500 trials, the highest win was a meager 44 (four games, all different), and |
'''output''' when running 1,500 trials, the highest win was a meager 44 (four games, all different), and |
||
one of them is shown below. |
one of them is shown below. |
||
<pre style="height:100ex |
<pre style="height:100ex"> |
||
·╞···╔══╗··· |
·╞···╔══╗··· |
||
·|···║··║··· |
·|···║··║··· |