Cistercian numerals: Difference between revisions

m
→‎{{header|jq}}: <pre style="height:20lh;overflow:auto>
m (→‎{{header|FutureBasic}}: fix screenshot filename)
m (→‎{{header|jq}}: <pre style="height:20lh;overflow:auto>)
 
(16 intermediate revisions by 7 users not shown)
Line 424:
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Cistercian_numerals.png Screenshot from Atari 8-bit computer]
=={{header|ALGOL 68}}==
<syntaxhighlight lang="algol68">
BEGIN # draw some Cistercian Numerals #
 
INT ch = 6; # height of the representation of a Cistercian Numeral #
INT cw = 5; # width of the representation of a Cistercian Numeral #
INT cm = ( cw + 1 ) OVER 2; # mid-point of a line in the representation #
# of a Cistercian Numeral #
# returns a 5x6 CHAR array representing the Cistercian Nuneral of n #
# 0 <= m <= 9999 must be TRUE #
OP TOCISTERCIAN = ( INT n )[,]CHAR:
IF n < 0 OR n > 9999 THEN # invalid n #
( "?????", "?????", "?????", "?????", "?????", "?????" )
ELSE # n is OK #
# if ch isn't 6 or cw isn't 5, the strinngs above and below will #
[ 1 : ch, 1 : cw ]CHAR cn := # need to be adjusted #
( " ", " | ", " | ", " | ", " | ", " | " );
[]STRING t digits = ( #1# "__", #2# ";;__", #3# "; /;/"
, #4# ";\; \", #5# "__; /;/", #6# "; |; |"
, #7# "_; |; |", #8# "; |;_|", #9# "_; |;_|"
);
[]STRING b digits = ( #1# "__", #2# ";;__", #3# "\; \"
, #4# " /;/", #5# "_/;/", #6# " |; |"
, #7# "_|; |", #8# " |; |;_", #9# "_|; |;_"
);
# adds 1 digit to the numeral #
PROC add digit = ( INT digit, BOOL flip horizontal, flip vertical )VOID:
IF digit > 0 THEN # have a visible digit #
STRING d = IF flip vertical THEN b digits[ digit ] ELSE t digits[ digit ] FI;
INT x := IF flip horizontal THEN -1 ELSE 1 FI + cm;
INT y := IF flip vertical THEN ch ELSE 1 FI;
INT x init = x;
INT x step = IF flip horizontal THEN -1 ELSE 1 FI;
INT y step = IF flip vertical THEN -1 ELSE 1 FI;
FOR c pos FROM LWB d TO UPB d DO
CHAR c = d[ c pos ];
IF c = ";" THEN
y +:= y step;
x := x init
ELSE
cn[ y, x ] := IF ( flip horizontal XOR flip vertical ) THEN
IF c = "/" THEN "\" ELIF c = "\" THEN "/" ELSE c FI
ELSE c
FI;
x +:= x step
FI
OD
FI # add digit # ;
INT v := n;
add digit( v MOD 10, FALSE, FALSE ); v OVERAB 10;
add digit( v MOD 10, TRUE, FALSE ); v OVERAB 10;
add digit( v MOD 10, FALSE, TRUE ); v OVERAB 10;
add digit( v MOD 10, TRUE, TRUE );
cn
FI # TOCISTERCIAN # ;
# inserts a Cistercian Numeral representation of n into an set of lines #
PROC insert cistercian = ( [,]CHAR cn, REF[]STRING lines, INT pos )VOID:
FOR i FROM 1 TO ch DO
lines[ i ][ pos : ( pos + cw ) - 1 ] := STRING( cn[ i, : ] )
OD # print cistercian # ;
 
[]INT tests = ( 0, 20, 300, 4000, 5555, 6789, 1968 );
# construct an array of blank lines and insert the Cistercian Numereals #
[ 1 : ch ]STRING lines; # into them #
FOR i FROM LWB lines TO UPB lines DO
lines[ i ] := " " * ( ( ( UPB tests -LWB tests ) + 1 ) * ( cw * 2 ) )
OD;
FOR i FROM LWB tests TO UPB tests DO print( ( whole( tests[ i ], - cw ), " " * cw ) ) OD;
print( ( newline ) );
INT i pos := 1 - ( cw * 2 );
FOR i FROM LWB tests TO UPB tests DO
insert cistercian( TOCISTERCIAN tests[ i ], lines, i pos +:= cw * 2 )
OD;
FOR i FROM LWB lines TO UPB lines DO print( ( lines[ i ], newline ) ) OD
END
</syntaxhighlight>
{{out}}
<pre>
0 20 300 4000 5555 6789 1968
__ __ _
| | | | \ | / | | | | | |
| __| | | \|/ |_|_| | |_|
| | | | | | |_
| | | / /| /|\ | | | | |
| | |/ / | /_|_\ | |_| __|_|
</pre>
 
=={{header|AutoHotkey}}==
<syntaxhighlight lang="autohotkey">CistercianNumerals(num){
Line 487 ⟶ 575:
   #       #       #       ##    # #     # # #  #  #  #    #   
   #       #       #       #    #  #    ####### #  ####    #   </pre>
 
=={{header|AWK}}==
<syntaxhighlight lang="awk">
Line 1,839 ⟶ 1,928:
x x x
xxxxxxxxxxx</pre>
=={{header|EasyLang}}==
[https://easylang.dev/show/#cod=tZTBboMwDIbvPMUv7VZUFEJo6WFPUnEqVIvUJlOLOnj7Om6gBQbamMbBij/i33aC+bzYAw76WqFGA4MIUQDgpE35pYvqAyJKHSjqfY537KGwVg+TM286zrDlR3uBRmWhnMcCtI1UdN6CxoHmFUgiEitatYiAwdkWiIVHhlGhb090trfSle/dN/iFa4LbCpENtmLdoXaXd/WRs8befY0JXYlP7gND11r/ZXnyKnJCZU5kqJEsqWQoohYUMuom/YMIetfxjfhmJD5uZzZDp7RdcmC/Os1sIsMPNGaTdwl2/5QAE7fAM8+Gwujjl0EU1Nyom2MDbWjCBWJIgUQIKEEmpQebbbYjKpPH2Ps/SSZg+mp3 Run it]
 
<syntaxhighlight>
proc cist x y n . .
linewidth 0.5
dx[] = [ 4 -4 4 -4 ]
dy[] = [ 4 4 -4 -4 ]
for i to 4
dx = dx[i]
dy = dy[i]
dy2 = 2 * dy
d = n mod 10
n = n div 10
move x y
#
line x y + 8
move x y - 8
line x y
if d = 1
move x y + dy2
line x + dx y + dy2
elif d = 2
move x y + dy
line x + dx y + dy
elif d = 3
move x y + dy2
line x + dx y + dy
elif d = 4
move x y + dy
line x + dx y + dy2
elif d = 5
move x y + dy
line x + dx y + dy2
line x y + dy2
elif d = 6
move x + dx y + dy
line x + dx y + dy2
elif d = 7
move x y + dy2
line x + dx y + dy2
line x + dx y + dy
elif d = 8
move x y + dy
line x + dx y + dy
line x + dx y + dy2
elif d = 9
move x y + dy
line x + dx y + dy
line x + dx y + dy2
line x y + dy2
.
.
x += 12
.
x = 8
for n in [ 0 1 20 300 4000 5555 6789 2023 ]
cist x 80 n
x += 12
.
</syntaxhighlight>
 
=={{header|F_Sharp|F#}}==
<syntaxhighlight lang="fsharp">
Line 1,931 ⟶ 2,082:
# O###
</pre>
 
=={{header|Factor}}==
{{works with|Factor|0.99 2020-08-14}}
Line 2,054 ⟶ 2,206:
+ +
</pre>
 
=={{header|Fōrmulæ}}==
 
{{FormulaeEntry|page=https://formulae.org/?script=examples/Cistercian_numerals}}
 
'''Solution'''
 
We can take advantage of the coordinate transformations.
 
'''Part 1. Glyphs for each digit'''
 
The glyphs of each "digit" are the same, excepting they are mirrored according to its place ("units", "tens", "hundreds" and "thousands"), so we have generic code for each.
 
The following specification are for "units" and it is independent of size. They are referred to the top-right "quadrant" of the complete number, which has mathematical coordinate system, being (-1, -1) the bottom-left corner, and (1, 1) the opposite one, hence, the center is (0, 0).
 
Please notice that they are provided as an array of (9) lambda expressions. There is no glyph for zero.
 
[[File:Fōrmulæ - Cistercian numerals 01.png]]
 
'''Part 2. Mirroring for "tens", "hundreds" and "thousands"'''
 
The following is the specification to change the scale, according to the place and to produce the mirrored effect. Notice that there is no specification for "units", because the definitions of glyphs are based on this place and therefore there is no transformation to apply.
 
[[File:Fōrmulæ - Cistercian numerals 02.png]]
 
'''Part 3. Function to draw a Cistercian number'''
 
Finally, the following function creates the representation of the Cistercian number.
 
Notice that the origin is initially translated to the center of the graphics, and also is scaled to the size of the graphics too, in order to define the system of coordinates.
 
[[File:Fōrmulæ - Cistercian numerals 03.png]]
 
'''Test cases'''
 
[[File:Fōrmulæ - Cistercian numerals 04.png]]
 
[[File:Fōrmulæ - Cistercian numerals 05.png]]
 
'''Additional case. Creating all the Cistercian numerals in a single image'''
 
The following program creates a big image, and copies into it all the 10,000 different Cistercian numerals:
 
[[File:Fōrmulæ - Cistercian numerals 06.png]]
 
The result is a 4000 x 6010 pixels image. Click or tap on the following thumbnail to enlarge:
 
[[File:Fōrmulæ - Cistercian numerals 07.png|200px|link=https://static.miraheze.org/rosettacodewiki/c/c0/F%C5%8Drmul%C3%A6_-_Cistercian_numerals_07.png]]
 
=={{header|FutureBasic}}==
Line 2,081 ⟶ 2,278:
 
 
void local fn PathDraw1PathDraw( path as BezierPathRef, lines as CFStringRef, x as CGFloat, y as CGFloat )
CGPoint pt1, pt2
BezierPathMoveToPoint( path, fn CGPointMake( x, y ) )
long i
BezierPathLineToPoint( path, fn CGPointMake( x + _lineLength, y ) )
for i = 0 to 4
end fn
if ( intval(mid(lines,i,1)) )
 
select ( i )
void local fn PathDraw2( path as BezierPathRef, x as CGFloat, y as CGFloat )
case 0
BezierPathMoveToPoint( path, fn CGPointMake( x, y + _lineLength ) )
BezierPathLineToPoint( path, pt1 = fn CGPointMake( x + _lineLength, y + _lineLength ) )
pt2 = fn CGPointMake( x + _lineLength, y + _lineLength )
end fn
case 1
 
pt1 = fn CGPointMake( x, y + _lineLength )
void local fn PathDraw3( path as BezierPathRef, x as CGFloat, y as CGFloat )
BezierPathMoveToPoint( path, pt2 = fn CGPointMake( x + _lineLength, y ) )
case 2
BezierPathLineToPoint( path, fn CGPointMake( x + _lineLength, y + _lineLength ) )
pt1 = fn CGPointMake( x, y )
end fn
pt2 = fn CGPointMake( x + _lineLength, y + _lineLength )
 
case 3
void local fn PathDraw4( path as BezierPathRef, x as CGFloat, y as CGFloat )
BezierPathMoveToPoint( path, pt1 = fn CGPointMake( x, y + _lineLength ) )
BezierPathLineToPoint( path, pt2 = fn CGPointMake( x + _lineLength, y )+ _lineLength )
case 4
end fn
pt1 = fn CGPointMake( x, y )
 
pt2 = fn CGPointMake( x + _lineLength, y )
void local fn PathDraw5( path as BezierPathRef, x as CGFloat, y as CGFloat )
end select
fn PathDraw4( path, x, y )
fn PathDraw1 BezierPathMoveToPoint( path, x, ypt1 )
BezierPathLineToPoint( path, pt2 )
end fn
end if
 
next
void local fn PathDraw6( path as BezierPathRef, x as CGFloat, y as CGFloat )
BezierPathMoveToPoint( path, fn CGPointMake( x + _lineLength, y ) )
BezierPathLineToPoint( path, fn CGPointMake( x + _lineLength, y + _lineLength ) )
end fn
 
void local fn PathDraw7( path as BezierPathRef, x as CGFloat, y as CGFloat )
fn PathDraw6( path, x, y )
fn PathDraw1( path, x, y )
end fn
 
void local fn PathDraw8( path as BezierPathRef, x as CGFloat, y as CGFloat )
fn PathDraw6( path, x, y )
fn PathDraw2( path, x, y )
end fn
 
void local fn PathDraw9( path as BezierPathRef, x as CGFloat, y as CGFloat )
fn PathDraw8( path, x, y )
fn PathDraw1( path, x, y )
end fn
 
void local fn PathDrawNum( path as BezierPathRef, num as long, x as CGFloat, y as CGFloat )
select ( num )
case 1 : fn PathDraw1( path, x, y )
case 2 : fn PathDraw2( path, x, y )
case 3 : fn PathDraw3( path, x, y )
case 4 : fn PathDraw4( path, x, y )
case 5 : fn PathDraw5( path, x, y )
case 6 : fn PathDraw6( path, x, y )
case 7 : fn PathDraw7( path, x, y )
case 8 : fn PathDraw8( path, x, y )
case 9 : fn PathDraw9( path, x, y )
end select
end fn
 
 
void local fn ViewDrawRect
CFArrayRef lines = @[@"00001",@"00010",@"00100",@"01000",@"01001",@"10000",@"10001",@"10010",@"10011"]
CFStringRef numString = fn ViewProperty( _numView, @"num" )
if ( numString )
Line 2,149 ⟶ 2,316:
for i = 0 to 3
BezierPathRef path = fn BezierPathWithRect( fn ViewBounds(_numView) )
BezierPathMoveToPoint( path, fn CGPointMake( x, y ) )
BezierPathLineToPoint( path, fn CGPointMake( x, y + _numHeight ) )
long num = intval( mid( numString, i, 1 ) )
if ( num )
fn PathDrawNumPathDraw( path, lines[num-1], x, y )
if ( i < 3 )
CGFloat xScale = 1.0, yScale = 1.0
select ( i )
case 0 : xScale = -1.0 : yScale = -1.0 // 1000
select ( i )
case 01 : xScaleyScale = -1.0 : yScale = -1.0 // 1000100
case 12 : yScalexScale = -1.0 // 10010
caseend 2 : xScale = -1.0 // 10select
case else // 1-9
// do nothing
end select
if ( xScale < 0.0 || yScale < 0.0 )
CGRect bounds = fn BezierPathBounds( path )
AffineTransformRef tx = fn AffineTransformInit
Line 2,172 ⟶ 2,335:
if ( xScale < 0.0 ) then AffineTransformTranslate( tx, -bounds.origin.x-bounds.size.width, 0.0 )
if ( yScale < 0.0 ) then AffineTransformTranslate( tx, 0.0, -bounds.size.height )
BezierPathTransformUsingAffineTranform( path, tx )
end if
end if
Line 2,999 ⟶ 3,162:
{{out}}<pre>
https://jsfiddle.net/43tsmn9z</pre>
=={{header|jq}}==
'''Works with jq, the C implementation of jq'''
 
'''Works with gojq, the Go implementation of jq'''
 
'''Adapted from [[#Wren|Wren]]'''
<syntaxhighlight lang="jq">
### Generic function
# Replace whatever is at .[$i:$i+1] with $x.
# The input and $x should be of the same type - strings or arrays.
def replace($i; $x): .[:$i] + $x + .[$i+1:];
 
### Cistercian numerals
 
# The canvas: an array of strings
def canvas:
(" " * 11) as $row
| [range(0; 15) | $row | replace(5; "x")];
def horiz($c1; $c2; $r):
reduce range($c1; $c2+1) as $c (.; .[$r] |= replace($c; "x"));
 
def verti($r1; $r2; $c):
reduce range($r1; $r2+1) as $r (.; .[$r] |= replace($c; "x"));
 
def diagd($c1; $c2; $r):
reduce range($c1; $c2+1) as $c (.; .[$r+$c-$c1] |= replace($c;"x"));
 
def diagu($c1; $c2; $r):
reduce range($c1; $c2+1) as $c (.; .[$r-$c+$c1] |= replace($c; "x"));
 
# input: the canvas
def draw($n):
if $n == 0 then .
elif $n == 1 then horiz(6; 10; 0)
elif $n == 2 then horiz(6; 10; 4)
elif $n == 3 then diagd(6; 10; 0)
elif $n == 4 then diagu(6; 10; 4)
elif $n == 5 then draw(1) | draw(4)
elif $n == 6 then verti(0; 4; 10)
elif $n == 7 then draw(1) | draw(6)
elif $n == 8 then draw(2) | draw(6)
elif $n == 9 then draw(1) | draw(8)
elif $n == 10 then horiz(0; 4; 0)
elif $n == 20 then horiz(0; 4; 4)
elif $n == 30 then diagu(0; 4; 4)
elif $n == 40 then diagd(0; 4; 0)
elif $n == 50 then draw(10) | draw(40)
elif $n == 60 then verti(0; 4; 0)
elif $n == 70 then draw(10) | draw(60)
elif $n == 80 then draw(20) | draw(60)
elif $n == 90 then draw(10) | draw(80)
elif $n == 100 then horiz(6; 10; 14)
elif $n == 200 then horiz(6; 10; 10)
elif $n == 300 then diagu(6; 10; 14)
elif $n == 400 then diagd(6; 10; 10)
elif $n == 500 then draw(100) | draw(400)
elif $n == 600 then verti(10; 14; 10)
elif $n == 700 then draw(100) | draw(600)
elif $n == 800 then draw(200) | draw(600)
elif $n == 900 then draw(100) | draw(800)
elif $n == 1000 then horiz(0; 4; 14)
elif $n == 2000 then horiz(0; 4; 10)
elif $n == 3000 then diagd(0; 4; 10)
elif $n == 4000 then diagu(0; 4; 14)
elif $n == 5000 then draw(1000) | draw(4000)
elif $n == 6000 then verti(10; 14; 0)
elif $n == 7000 then draw(1000) | draw(6000)
elif $n == 8000 then draw(2000) | draw(6000)
elif $n == 9000 then draw(1000) | draw(8000)
else "unable to draw \(.)" | error
end;
 
def cistercian:
(./1000|floor) as $thousands
| (. % 1000) as $n
| ($n/100|floor) as $hundreds
| ($n % 100) as $n
| ($n/10|floor) as $tens
| ($n % 10) as $ones
| "\(.):",
( canvas
| draw($thousands*1000)
| draw($hundreds*100)
| draw($tens*10)
| draw($ones)
| .[] ),
"" ;
 
0, 1, 20, 300, 4000, 5555, 6789, 9999
| cistercian
</syntaxhighlight>
{{output}}
<pre style="height:20lh;overflow:auto>
0:
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
 
1:
xxxxxx
x
x
x
x
x
x
x
x
x
x
x
x
x
x
 
20:
x
x
x
x
xxxxxx
x
x
x
x
x
x
x
x
x
x
 
300:
x
x
x
x
x
x
x
x
x
x
x x
x x
x x
x x
xx
 
4000:
x
x
x
x
x
x
x
x
x
x
xx
x x
x x
x x
x x
 
5555:
xxxxxxxxxxx
x x x
x x x
x x x
xxx
x
x
x
x
x
xxx
x x x
x x x
x x x
xxxxxxxxxxx
 
6789:
x xxxxxx
x x x
x x x
x x x
xxxxxxxxxxx
x
x
x
x
x
x x x
x x x
x x x
x x x
x xxxxxx
 
9999:
xxxxxxxxxxx
x x x
x x x
x x x
xxxxxxxxxxx
x
x
x
x
x
xxxxxxxxxxx
x x x
x x x
x x x
xxxxxxxxxxx
 
</pre>
 
=={{header|Julia}}==
Gtk graphic version.
Line 3,059 ⟶ 3,454:
mooncipher()
</syntaxhighlight>
 
=={{header|Kotlin}}==
{{trans|C++}}
Line 5,010 ⟶ 5,406:
x x x
xxxxxxxxxxx</pre>
 
=={{header|Rust}}==
{{trans|C}}
<syntaxhighlight lang="rust">use once_cell::sync::Lazy;
 
const GRID_SIZE: usize = 15;
static mut CANVAS: Lazy<Vec<[char; GRID_SIZE]>> = Lazy::new(|| vec![[' '; GRID_SIZE]; GRID_SIZE],);
 
/// initialize CANVAS
fn init_n() {
for i in 0..GRID_SIZE {
for j in 0..GRID_SIZE {
unsafe { CANVAS[i][j] = ' '; }
}
unsafe { CANVAS[i][5] = '#'; }
}
}
 
/// draw horizontal
fn horizontal(c1: usize, c2: usize, r: usize) {
for c in c1..=c2 {
unsafe { CANVAS[r][c] = '#'; }
}
}
 
/// draw vertical
fn vertical(r1: usize, r2: usize, c: usize) {
for r in r1..=r2 {
unsafe { CANVAS[r][c] = '#'; }
}
}
 
/// draw diagonal NE to SW
fn diag_d(c1 : usize, c2: usize, r: usize) {
for c in c1..=c2 {
unsafe { CANVAS[r + c - c1][c] = '#'; }
}
}
 
/// draw diagonal SE to NW
fn diag_u(c1: usize, c2: usize, r: usize) {
for c in c1..=c2 {
unsafe { CANVAS[r + c1 - c][c] = '#'; }
}
}
 
/// Mark the portions of the ones place.
fn draw_ones(v: i32) {
match v {
1 => horizontal(6, 10, 0),
2 => horizontal(6, 10, 4),
3 => diag_d(6, 10, 0),
4 => diag_u(6, 10, 4),
5 => { draw_ones(1); draw_ones(4); },
6 => vertical(0, 4, 10),
7 => { draw_ones(1); draw_ones(6); },
8 => { draw_ones(2); draw_ones(6); },
9 => { draw_ones(1); draw_ones(8); },
_ => {},
}
}
 
/// Mark the portions of the tens place.
fn draw_tens(v: i32) {
match v {
1 => horizontal(0, 4, 0),
2 => horizontal(0, 4, 4),
3 => diag_u(0, 4, 4),
4 => diag_d(0, 4, 0),
5 => { draw_tens(1); draw_tens(4); },
6 => vertical(0, 4, 0),
7 => { draw_tens(1); draw_tens(6); },
8 => { draw_tens(2); draw_tens(6); },
9 => { draw_tens(1); draw_tens(8); },
_ => {},
}
}
 
/// Mark the portions of the hundreds place.
fn draw_hundreds(hundreds: i32) {
match hundreds {
1 => horizontal(6, 10, 14),
2 => horizontal(6, 10, 10),
3 => diag_u(6, 10, 14),
4 => diag_d(6, 10, 10),
5 => { draw_hundreds(1); draw_hundreds(4) },
6 => vertical(10, 14, 10),
7 => { draw_hundreds(1); draw_hundreds(6); },
8 => { draw_hundreds(2); draw_hundreds(6); },
9 => { draw_hundreds(1); draw_hundreds(8); },
_ => {},
}
}
 
/// Mark the portions of the thousands place.
fn draw_thousands(thousands: i32) {
match thousands {
1 => horizontal(0, 4, 14),
2 => horizontal(0, 4, 10),
3 => diag_d(0, 4, 10),
4 => diag_u(0, 4, 14),
5 => { draw_thousands(1); draw_thousands(4); },
6 => vertical(10, 14, 0),
7 => { draw_thousands(1); draw_thousands(6); },
8 => { draw_thousands(2); draw_thousands(6); },
9 => { draw_thousands(1); draw_thousands(8); },
_ => {},
}
}
 
/// Mark the char matrix for the numeral drawing.
fn draw(mut v: i32) {
let thousands: i32 = v / 1000;
v %= 1000;
let hundreds: i32 = v / 100;
v %= 100;
let tens: i32 = v / 10;
let ones: i32 = v % 10;
if thousands > 0 {
draw_thousands(thousands);
}
if hundreds > 0 {
draw_hundreds(hundreds);
}
if tens > 0 {
draw_tens(tens);
}
if ones > 0 {
draw_ones(ones);
}
}
 
/// Test the drawings as outout to stdout.
fn test_output(n: i32) {
println!("{n}");
init_n();
draw(n);
unsafe {
for line in CANVAS.iter() {
for c in line.iter() {
print!("{}", *c);
}
println!();
}
}
println!("\n");
}
 
fn main() {
for n in [0, 1, 20, 300, 2022, 4000, 5555, 6789, 9999] {
test_output(n);
}
}
</syntaxhighlight>{{out}}
<pre>
0
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
 
 
1
######
#
#
#
#
#
#
#
#
#
#
#
#
#
#
 
 
20
#
#
#
#
######
#
#
#
#
#
#
#
#
#
#
 
 
300
#
#
#
#
#
#
#
#
#
#
# #
# #
# #
# #
##
 
 
2022
#
#
#
#
###########
#
#
#
#
#
######
#
#
#
#
 
 
4000
#
#
#
#
#
#
#
#
#
#
##
# #
# #
# #
# #
 
 
5555
###########
# # #
# # #
# # #
###
#
#
#
#
#
###
# # #
# # #
# # #
###########
 
 
6789
# ######
# # #
# # #
# # #
###########
#
#
#
#
#
# # #
# # #
# # #
# # #
# ######
 
 
9999
###########
# # #
# # #
# # #
###########
#
#
#
#
#
###########
# # #
# # #
# # #
###########
</pre>
 
=={{header|Wren}}==
{{libheader|Wren-fmt}}
This draws each Cistercian numeral on the terminal within a grid of 15 rows by 11 columns. The vertical line segment is drawn at column 5 (zero indexed) so there are 5 columns at either side.
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Fmt
 
var n
2,442

edits