A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Palindromic Number in Elvish page! Here, you'll find the source code for this program as well as a description of how the program works.
use str
fn die {
echo 'Usage: please input a non-negative integer'
exit 1
}
if (> 1 (count $args)) {
die
}
var n = $args[0]
# Check if the number contains a decimal point
if (str:contains $n .) {
die
}
try {
var q = (+ $n 1)
} catch _ {
die
}
if (> 0 $n) {
die
}
if (eq $n (echo $n|rev)) {
echo true
} else {
echo false
}
Palindromic Number in Elvish 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.