View/Edit #9682:isprime

Switch to edit mode.

Name(s): isprime
1:  ft = ftime()
2:  what = toint(dobjstr)
3:  test = toint(sqrt(tofloat(dobjstr)))
4:  for a in [2..test]
5:    b = what / a
6:    if (a * b == what)
7:      return player:tell("You lose: ", a, " * ", b, " = ", what)
8:    endif
9:  endfor
10: player:tell("It's prime.")
11: player:tell("[", ftime() - ft, " seconds.]")
12: "Last modified by Dax (#789) on Tue May  3 14:09:39 2005 MDT."

Verb arguments: any none none
Verb perms: Readable NOT-Debug
Verb owned by: Dizzy_Devil (#9682)

You are not logged in.

[home | help | who | search | setup | code]