Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
isPrime = (n) ->
return false if n < 2
for i in [2..math.floor(math.sqrt n)]
return false if n % i == 0
true
checkNumber = (num) ->
print "#{num} is #{if isPrime num then 'Prime' else 'Not Prime'}"
# Simulate actions
checkNumber 7
checkNumber 10
checkNumber 13Coding works best on desktop or with an external keyboard.