Count in octal: Difference between revisions

add sed
(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
(add sed)
Line 3,182:
=={{header|Scratch}}==
[[File:ScratchCountInOctal.png]]
 
=={{header|sed}}==
This program expects one line (consisting of a non-negative octal integer) as start value:
<syntaxhighlight lang="sed">:l
p
s/^7*$/0&/
h
y/01234567/12345670/
x
G
s/.7*\n.*\([^0]\)/\1/
bl</syntaxhighlight>
{{out}}
<pre>
$ echo 0 | sed -f count_oct.sed | head
0
1
2
3
4
5
6
7
10
11
</pre>
 
=={{header|Seed7}}==
559

edits