September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,3 @@
for i from 10 downto 0 do
print( i )
od

View file

@ -0,0 +1,2 @@
' Downward for
FOR i = 10 DOWNTO 0 : PRINT i : NEXT

View file

@ -0,0 +1,3 @@
10 FOR I = 10 TO 0 STEP -1
20 PRINT I
30 NEXT

View file

@ -0,0 +1,2 @@
for (i = 10; i >= 0; i--) i
quit

View file

@ -0,0 +1,13 @@
c
[macro s(swap) - (a b : b a)]s.
[Sa Sb La Lb] ss
[macro d(2dup) - (a b : a b a b)]s.
[Sa d Sb La d Lb lsx] sd
[macro m(for) - ]s.
[lfx 1 - ldx !<m ] sm
0 10 ldx [p] sf !<m
q

View file

@ -0,0 +1,5 @@
|dc < ./for.dc
10
9
...
0

View file

@ -0,0 +1,54 @@
[ Loop with downward counter
==========================
A program for the EDSAC
Prints the integers 10 down to 0
The counter is stored at address 20@
Its initial value is 9 * 2^12
(9 in the high 5 bits, representing
the character '9') and it counts
down in steps of 2^12
Works with Initial Orders 2 ]
T56K [ set load point ]
GK [ set base address ]
[ orders ]
O14@ [ print figure shift ]
O15@ [ print '1' ]
O16@ [ print '0' ]
O17@ [ print CR ]
O18@ [ print LF ]
[ 5 ] O20@ [ print c ]
O17@ [ print CR ]
O18@ [ print LF ]
T19@ [ acc := 0 ]
A20@ [ acc += c ]
S15@ [ acc -:= character '1' ]
U20@ [ c := acc ]
E5@ [ branch on non-negative ]
ZF [ stop ]
[ constants ]
[ 14 ] #F [ πF -- figure shift ]
[ 15 ] QF [ character '1' ]
[ 16 ] PF [ character '0' ]
[ 17 ] @F [ θF -- CR ]
[ 18 ] &F [ ΔF -- LF ]
[ variables ]
[ 19 ] P0F [ used to clear acc ]
[ 20 ] OF [ character c = '9' ]
EZPF [ start when loaded ]

View file

@ -1,6 +0,0 @@
open console
countDown m n | n < m = ()
| else = writen n $ countDown m (n-1)
countDown 0 10

View file

@ -0,0 +1,8 @@
Public Sub Main()
Dim siCount As Short
For siCount = 10 DownTo 0
Print siCount;;
Next
End

View file

@ -1,2 +1,4 @@
import Control.Monad
forM_ [10,9..0] print
main :: IO ()
main = forM_ [10,9 .. 0] print

View file

@ -0,0 +1,3 @@
I8 i;
for (i = 10; i >= 0; --i)
Print("%d\n", i);

View file

@ -0,0 +1,5 @@
// version 1.0.6
fun main(args: Array<String>) {
for (i in 10 downTo 0) print("$i ")
}

View file

@ -1 +0,0 @@
for x in countdown(10,0): echo(x)

View file

@ -1 +0,0 @@
<@ ITEFORLITLITLITLIT>0|<@ SAYVALFOR>...</@>|10|-1</@>

View file

@ -1 +0,0 @@
<# 迭代迭代次数字串字串字串字串>0|<# 显示值迭代次数>...</#>|10|-1</#>

View file

@ -0,0 +1,3 @@
> i, 10..0,-1
#.output(i)
<

View file

@ -0,0 +1,11 @@
forvalues n=10(-1)0 {
display `n'
}
forvalues n=10 9 to 0 {
display `n'
}
foreach n of numlist 10/0 {
display `n'
}

View file

@ -0,0 +1,4 @@
foreach n in ([10..0,-1]){ println(n) }
[10..0,-1].apply() //-->L(10,9,8,7,6,5,4,3,2,1,0)
// tail recursion
fcn(n){ n.println(); if(n==0)return(); return(self.fcn(n-1)) }(10)