Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,24 @@
prod := 1.
sum := 0.
x := 5.
y := -5.
z := -2.
one := 1.
three := 3.
seven := 7.
(three negated to: 3**3 by: three ) ,
(seven negated to: seven by: x ) ,
(555 to: 550-y ) ,
(22 to: -28 by: three negated) ,
(1927 to: 1939 ) ,
(x to: y by:z ) ,
(11**x to: 11**x + one )
do:[:j |
sum := sum + j abs.
((prod abs < (2**27)) and:[ j ~= 0 ]) ifTrue:[
prod := prod*j
].
].
Transcript show:' sum = '; showCR:sum.
Transcript show:'prod = '; showCR:prod

View file

@ -0,0 +1,26 @@
prod := 1.
sum := 0.
x := 5.
y := -5.
z := -2.
one := 1.
three := 3.
seven := 7.
action :=
[:j |
sum := sum + j abs.
((prod abs < (2**27)) and:[ j ~= 0 ]) ifTrue:[
prod := prod*j
].
].
(three negated to: 3**3 by: three ) do:action.
(seven negated to: seven by: x ) do:action.
(555 to: 550-y ) do:action.
(22 to: -28 by: three negated) do:action.
(1927 to: 1939 ) do:action.
(x to: y by:z ) do:action.
(11**x to: 11**x + one ) do:action.
Transcript show:' sum = '; showCR:sum.
Transcript show:'prod = '; showCR:prod

View file

@ -0,0 +1,16 @@
...
{
(three negated to: 3**3 by: three ) .
(seven negated to: seven by: x ) .
(555 to: 550-y ) .
(22 to: -28 by: three negated) .
(1927 to: 1939 ) .
(x to: y by:z ) .
(11**x to: 11**x + one ) .
} do:[:eachRange |
eachRange
select:[:j | ((prod abs < (2**27)) and:[ j ~= 0 ]) ]
thenDo:[:j | prod := prod*j ].
]
].
...

View file

@ -0,0 +1,2 @@
** arg
^ self raisedTo: arg