Suzhou numerals (蘇州碼子; also 花碼) are Chinese decimal numerals:
0 〇
1 〡 一
2 〢 二
3 〣 三
4 〤
5 〥
6 〦
7 〧
8 〨
9 〩
They pretty much work like Arabic numerals, except that when there are consecutive digits belonging to the set {1, 2, 3}
, the digits alternate between vertical stroke notation {〡,〢,〣}
and horizontal stroke notation {一,二,三}
to avoid ambiguity. The first digit of such a consecutive group is always written with vertical stroke notation.
The task is to convert a positive integer into Suzhou numerals.
Test cases
1 〡
11 〡一
25 〢〥
50 〥〇
99 〩〩
111 〡一〡
511 〥〡一
2018 〢〇〡〨
123321 〡二〣三〢一
1234321 〡二〣〤〣二〡
9876543210 〩〨〧〦〥〤〣二〡〇
Shortest code in bytes wins.