Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
15
Task/Hailstone-sequence/Ursa/hailstone-sequence.ursa
Normal file
15
Task/Hailstone-sequence/Ursa/hailstone-sequence.ursa
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "math"
|
||||
|
||||
def hailstone (int n)
|
||||
decl int<> seq
|
||||
while (> n 1)
|
||||
append n seq
|
||||
if (= (mod n 2) 0)
|
||||
set n (floor (/ n 2))
|
||||
else
|
||||
set n (int (+ (* 3 n) 1))
|
||||
end if
|
||||
end while
|
||||
append n seq
|
||||
return seq
|
||||
end hailstone
|
||||
Loading…
Add table
Add a link
Reference in a new issue