Code I’d originally written in PostScript would parse a text file containing all the moves of a chess game, and print out pages that looked like this:
These are the four Postscript files and 16 functions which I will now attempt to rewrite in Javascript:
ChessPage.ps
Main
CreateGameArray
CreateBoardArray
ShowPage
DrawBoard
ChangeBoard
ReadGame.ps
DrawBoard.ps
HexCode.ps
When line segments join at sharp angles “spikes” are produced. This test image shows at which range they are cut off.
%!PS BezierMiterJoin.ps
2 2 scale
20 20 translate
/a 10 def
0 20 280 {
/x exch def
0 0 moveto
x 300 lineto
100 200 200 100 300 0 curveto
} for
10 setlinewidth
strokepath
0 setlinewidth
stroke showpage
# CASCADE
#set whatever "•[-{wordset} 0-9]*∂t"
set whatever "•[-{wordset}., ''&]*∂t" #NEED THE TAB?
find /{whatever}/
set theString "`catenate §`"
loop
find /{whatever}/
if "`catenate §`" == "∂t"
replace § "{theString}"
else
set theString "`catenate §`"
replace § "*"
end
if "{theString}" == ""
break
end
end
If you consider 4/1/2011 to 4/7/2011 as one week, and 4/1/2011 to 4/8/2011 as 1w1d, then:
Int ( ( date2 – date1 + 1 ) / 7 ) & “w” & Mod ( date2 – date1 + 1; 7 ) & “d”
If [ Get ( ActiveFieldName ) = “Task” ]
Set Selection [ End Position: Get ( ActiveSelectionSize ) ]
Insert Calculated Result [ ” <- ” & Get ( CurrentTimeStamp ) ]
End If
To get “<BR>” in your blog’s posting, enter this code in HTML :
“<BR>”
Character entity references start with ampersand.
For the coding challenged