Morpion solitaire: Difference between revisions

Content added Content deleted
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,79,'─') /*right justify it.*/
'(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('═',79)
if wins==0 then call t copies('═',sw)
else call t right('count of (above) wins =' wins,79,'═')
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 &nbsp; '''LINESIZE''' &nbsp; REXX program (or BIF) which is used to determine the screen width (or linesize) of the terminal (console).
<br>The &nbsp; '''LINESIZE.REX''' &nbsp; 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;overflow:scroll">
<pre style="height:100ex">
·╞···╔══╗···
·╞···╔══╗···
·|···║··║···
·|···║··║···