Cistercian numerals: Difference between revisions

Line 1,751:
NB. http://rosettacode.org/wiki/Cistercian_numerals
NB. converted from
NB. https://scipython.com/blog/cistercian-numerals/
NB.# http://en.kpartner.kr/data/warrant-check-pzmwqyk/qrf56.php?3fff1d=cistercian-numbers-unicode
 
Dyad=: [: :
Line 1,789:
d_paths=: (, ((2-[),])/"1 L:0 , (,3&-)/"1 L:0 , ((2-[),(3-]))/"1 L:0) d_paths
d_paths=: , a: ,. _9]\ d_paths NB. adjust indexing
echo d_paths
 
NB.def transform(x, y, dx, dy, sc):
NB. """Transform the coordinates (x, y) into the scaled, displaced system."""
Line 1,823:
NB.def make_stave():
NB. """Output the SVG line element for the vertical stave."""
NB. x1, y1 = transform(1, 0, *tprms)>
NB. x2, y2 = transform(1, 3, *tprms)
NB. print('<line x1="{}" y1="{}" x2="{}" y2="{}"/>'.format(x1, y1, x2, y2),
NB. file=fo)
make_stave=: 3 :'y print~ ''<line x1="{}" y1="{}" x2="{}" y2="{}"/>'' format~ , TPRMS (transform"1) 1 0,:1 3'
Line 1,883:
n=. y
make_stave fo
if. y do.
fo make_digit"1 (,.~ i.@#) |. 10 #.inv n
end.
)
Anonymous user