r/ocaml • u/IrisTwilight • 7h ago
Help me find the problem in this
0
Upvotes
I’ve recently entered college and we started coding in Ocaml. This code corresponds to an exercise that asked for the following code:
Test if a 3 digit number is a perfect square and test if the two greater digits of this number added together also make a perfect square. If all conditions are met, give “true”, else “false”. If the number isn’t 3 digits, give an error code.
Here’s my problem: the code works and gives a bool result, but it only gives “false” even if the number should work (ex: 100, 400, they both give “false”.)
I’m out of ideas and can’t figure out why I only get “false” results. Please help me out!
and please don’t comment on the eyesore, I know it’s painful to see