A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Even Odd in Pyret page! Here, you'll find the source code for this program as well as a description of how the program works.
import cmdline-lib as CL
usage = "Usage: please input a number\n"
args = CL.command-line-arguments()
cases(Option) string-to-number(if args.length() > 1: args.get(1) else: "" end):
| none => print(usage)
| some(n) =>
if not(num-is-integer(n)): print(usage)
else if num-modulo(n, 2) == 0: print("Even\n")
else: print("Odd\n")
end
end
Even Odd in Pyret was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.