This week's code snippet, Palindromic Number in Julia, is brought to you by Subete and the Sample Programs repo.
function err()
println("Usage: please input a non-negative integer")
end
function palindrome_check(n)
new_num = 0
original = n
while (n > 0)
digit = n % 10
new_num = new_num * 10 + digit
n = 10
end
if(new_num == original)
return "true"
else
return "false"
end
end
try
n = parse(Int, ARGS[1])
if (n >= 0)
println(palindrome_check(n))
else
err()
end
catch e
err()
end
Below you'll find an up-to-date list of articles by me on The Renegade Coder. For ease of browsing, emojis let you know the article category (i.e., blog: βοΈ, code: π», meta: π, teach: π)
- π Canvas Is Not Built With Educators in Mind
- π» Workshopping a Tier List Generator
- βοΈ No, The GRE Should Not Be Reinstated
- βοΈ Summarizing My Dissertation for the Layman
- βοΈ 9 Things I Wish I Knew About Doctoral Programs
- βοΈ I Successfully Completed My PhD in Engineering Education
- π So You Want to Be a University Educator
- βοΈ Looking Forward to the Future
- π» Unpacking the Jargon Around Compilers, Interpreters, and More
- π» What Are Type Hints in Python?
Also, here are some fun links you can use to support my work.
This document was automatically rendered on 2025-01-03 using SnakeMD.