Cistercian numerals: Difference between revisions

m
Automated syntax highlighting fixup (second round - minor fixes)
m (syntax highlighting fixup automation)
m (Automated syntax highlighting fixup (second round - minor fixes))
Line 34:
:* '''[https://www.youtube.com/watch?v=9p55Qgt7Ciw Numberphile - The Forgotten Number System]'''
:* '''[https://www.dcode.fr/cistercian-numbers dcode.fr - Online Cistercian numeral converter]'''
 
 
=={{header|68000 Assembly}}==
This Sega Genesis cartridge can be compiled with VASM and run in the Fusion emulator.
<syntaxhighlight lang="68000devpac">;CONSTANTS
VFLIP equ %0001000000000000
HFLIP equ %0000100000000000
Line 316 ⟶ 314:
{{out}}
[https://ibb.co/Fz11L4w Screenshot of emulator]
 
=={{header|Action!}}==
<syntaxhighlight lang=Action"action!">BYTE FUNC AtasciiToInternal(CHAR c)
BYTE c2
 
Line 427 ⟶ 424:
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Cistercian_numerals.png Screenshot from Atari 8-bit computer]
 
=={{header|AutoHotkey}}==
<syntaxhighlight lang=AutoHotkey"autohotkey">CistercianNumerals(num){
x := []
;UPPER LEFT 0 1 2 3 4 5 6 7 8 9
Line 467 ⟶ 463:
return Trim(res, "`n")
}</syntaxhighlight>
Examples:<syntaxhighlight lang=AutoHotkey"autohotkey">Gui, font, S24, Consolas
Gui, add, Text, vE1 w150 r12
Gui, show, x0 y0
Line 491 ⟶ 487:
   #       #       #       ##    # #     # # #  #  #  #    #   
   #       #       #       #    #  #    ####### #  ####    #   </pre>
 
=={{header|AWK}}==
<syntaxhighlight lang=AWK"awk">
# syntax: GAWK -f CISTERCIAN_NUMERALS.AWK [-v debug={0|1}] [-v xc=anychar] numbers 0-9999 ...
#
Line 710 ⟶ 705:
invalid
</pre>
 
=={{header|C}}==
{{trans|C#}}
<syntaxhighlight lang="c">#include <stdio.h>
 
#define GRID_SIZE 15
Line 1,103 ⟶ 1,097:
x x x
xxxxxxxxxxx</pre>
 
=={{header|C++}}==
{{trans|Go}}
<syntaxhighlight lang="cpp">#include <array>
#include <iostream>
 
Line 1,497 ⟶ 1,490:
x x x
xxxxxxxxxxx</pre>
 
=={{header|D}}==
{{trans|Java}}
<syntaxhighlight lang="d">import std.stdio;
 
class Cistercian {
Line 1,847 ⟶ 1,839:
x x x
xxxxxxxxxxx</pre>
 
=={{header|F_Sharp|F#}}==
<syntaxhighlight lang="fsharp">
// Cistercian numerals. Nigel Galloway: February 2nd., 2021
let N=[|[[|' ';' ';' '|];[|' ';' ';' '|];[|' ';' ';' '|]];
Line 1,940 ⟶ 1,931:
# O###
</pre>
 
=={{header|Factor}}==
{{works with|Factor|0.99 2020-08-14}}
<syntaxhighlight lang="factor">USING: combinators continuations formatting grouping io kernel
literals math.order math.text.utils multiline sequences
splitting ;
Line 2,064 ⟶ 2,054:
+ +
</pre>
 
=={{header|Fōrmulæ}}==
 
Line 2,072 ⟶ 2,061:
 
In '''[https://formulae.org/?example=Cistercian_numerals this]''' page you can see the program(s) related to this task and their results.
 
=={{header|Go}}==
{{trans|Wren}}
<syntaxhighlight lang="go">package main
 
import "fmt"
Line 2,203 ⟶ 2,191:
Same as Wren example.
</pre>
 
=={{header|J}}==
Program writes a scalable vector graphics file containing all composable numbers. J code is alongside the original python source.
Line 2,212 ⟶ 2,199:
</pre>
The <tt>rc</tt> verb writes <tt>RC=. 0 1 20 300 666 4000 5555 6789</tt>
<syntaxhighlight lang=J"j">
NB. http://rosettacode.org/wiki/Cistercian_numerals
NB. converted from
Line 2,395 ⟶ 2,382:
)
</syntaxhighlight>
 
=={{header|Java}}==
{{trans|Kotlin}}
<syntaxhighlight lang="java">import java.util.Arrays;
import java.util.List;
 
Line 2,744 ⟶ 2,730:
x x x
xxxxxxxxxxx </pre>
 
=={{header|JavaScript}}==
Using a canvas.
<syntaxhighlight lang=javaScript"javascript">
// html
document.write(`
Line 2,853 ⟶ 2,838:
{{out}}<pre>
https://jsfiddle.net/43tsmn9z</pre>
 
=={{header|Julia}}==
Gtk graphic version.
<syntaxhighlight lang="julia">using Gtk, Cairo
 
const can = GtkCanvas(800, 100)
Line 2,914 ⟶ 2,898:
mooncipher()
</syntaxhighlight>
 
=={{header|Kotlin}}==
{{trans|C++}}
<syntaxhighlight lang="scala">import java.io.StringWriter
 
class Cistercian() {
Line 3,277 ⟶ 3,260:
x x x
xxxxxxxxxxx </pre>
 
=={{header|Lua}}==
{{trans|Go}}
<syntaxhighlight lang="lua">function initN()
local n = {}
for i=1,15 do
Line 3,536 ⟶ 3,518:
x x x
x x x x x x x x x x x</pre>
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<syntaxhighlight lang=Mathematica"mathematica">ClearAll[CistercianNumberEncodeHelper, CistercianNumberEncode]
\[Delta] = 0.25;
CistercianNumberEncodeHelper[0] := {}
Line 3,581 ⟶ 3,562:
{{out}}
A set of Graphics is shown for each of the numerals.
 
=={{header|Nim}}==
{{trans|Kotlin}}
<syntaxhighlight lang=Nim"nim">const Size = 15
 
type Canvas = array[Size, array[Size, char]]
Line 3,881 ⟶ 3,861:
xxxxxxxxxxx
</pre>
 
=={{header|Perl}}==
<syntaxhighlight lang="perl">#!/usr/bin/perl
 
use strict; # https://rosettacode.org/wiki/Cistercian_numerals
Line 3,944 ⟶ 3,923:
# # # # # # ######### # ##### #######
</pre>
 
=={{header|Phix}}==
<!--<syntaxhighlight lang=Phix"phix">(phixonline)-->
<span style="color: #000080;font-style:italic;">--
-- Define each digit as {up-down multiplier, left-right multiplier, char},
Line 4,028 ⟶ 4,006:
| + / | +-+-+ | +-+ +-+ +-+-+ +-+-+
</pre>
 
=={{header|Plain English}}==
<syntaxhighlight lang="plainenglish">To run:
Start up.
Show some example Cistercian numbers.
Line 4,170 ⟶ 4,147:
{{out}}
https://commons.wikimedia.org/wiki/File:Cistercian_numerals.png
 
=={{header|Python}}==
I tried to create a three-line font from UTF8 characters taking three lines per Cistercian number.
<syntaxhighlight lang="python"># -*- coding: utf-8 -*-
"""
Some UTF-8 chars used:
Line 4,294 ⟶ 4,270:
The pre tag may have to shift from one monospace font to a second that contains a character missing from the first. Those two individually monospaced fonts may have differing character widths between fonts (although consistent within individual monospaced fonts).<br>
Paste the output into a monospace code editor and the stems of each number might well align!
 
=={{header|Raku}}==
Handles 0 through 9999 only. No error trapping. If you feed it an unsupported number it will truncate to maximum 4 digits.
 
<syntaxhighlight lang="raku" line>my @line-segments = (0, 0, 0, 100),
(0, 0, 35, 0), (0, 35, 35, 35), (0, 0, 35, 35), (0, 35, 35, 0), ( 35, 0, 35, 35),
(0, 0,-35, 0), (0, 35,-35, 35), (0, 0,-35, 35), (0, 35,-35, 0), (-35, 0,-35, 35),
Line 4,349 ⟶ 4,324:
$out.say: q|</svg>|; # insert footer</syntaxhighlight>
[https://github.com/thundergnat/rc/blob/master/img/Cistercian-raku.svg See sample SVG image: (offsite link)]
 
=={{header|REXX}}==
A fair amount of code dealt with displaying multiple Cistercian numerals on the terminal, &nbsp; and also trying to present
Line 4,355 ⟶ 4,329:
 
Comprehensive error checking was also included.
<syntaxhighlight lang="rexx">/*REXX program displays a (non-negative 4-digit) integer in Cistercian (monk) numerals.*/
parse arg m /*obtain optional arguments from the CL*/
if m='' | m="," then m= 0 1 20 300 4000 5555 6789 9393 /*Not specified? Use defaults.*/
Line 4,459 ⟶ 4,433:
│ │ │ │/ / │ ─────┴───── │ └────┘ └────┘/
</pre>
 
=={{header|Ruby}}==
{{trans|Lua}}
<syntaxhighlight lang="ruby">def initN
n = Array.new(15){Array.new(11, ' ')}
for i in 1..15
Line 4,762 ⟶ 4,735:
x x x
xxxxxxxxxxx</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="ecmascript">import "/fmt" for Fmt
 
var n
10,327

edits