Foundations continued
Problem Solving
- Project euler 1: Refer Here
max = 1000
index = 1
sum = 0
until index < max do # looping
if index%3 == 0 or index%5 == 0 then # conditional statement
sum = sum + index
index = index + 1
print sum
- Project euler 2: Refer Here
a = 1
b = 1
c = 0
sum = 0
until c < 4000000
c = a + b
if c%2 == 0 then
sum = sum + c
a = b
b = c