Skip to main content
added 237 characters in body
Source Link
Downgoat
  • 29.2k
  • 6
  • 85
  • 157

Cheddar, 37 bytes

Looks like a full program is required which unfortunately means a lot of boilerplate:

print Math.prime(Number::IO.prompt()) 

This might not work on TIO so you'd have to put it into a file and call it that way

Function, 10 bytes

Math.prime 

This returns a function which checks if input is prime using Math.prime. Example:

$ cheddar primechecker.cheddar -x "[1, 3, 4, 10, 13] => (print) + f" 

Cheddar, 10 bytes

Math.prime 

This returns a function which checks if input is prime using Math.prime. Example:

$ cheddar primechecker.cheddar -x "[1, 3, 4, 10, 13] => (print) + f" 

Cheddar, 37 bytes

Looks like a full program is required which unfortunately means a lot of boilerplate:

print Math.prime(Number::IO.prompt()) 

This might not work on TIO so you'd have to put it into a file and call it that way

Function, 10 bytes

Math.prime 

This returns a function which checks if input is prime using Math.prime. Example:

$ cheddar primechecker.cheddar -x "[1, 3, 4, 10, 13] => (print) + f" 
Source Link
TF2Goat
  • 91
  • 1
  • 3

Cheddar, 10 bytes

Math.prime 

This returns a function which checks if input is prime using Math.prime. Example:

$ cheddar primechecker.cheddar -x "[1, 3, 4, 10, 13] => (print) + f"