Re:A prime number whose binary representation looks like a g...
by qualitytime on Saturday January 20, 2018 @04:23PM
(#16195499)
"write a short program that checks if a file is a prime number."
What do you mean? I tried googling but failed.
Re:A prime number whose binary representation looks like a g...
by colejohnson66 on Sunday January 21, 2018 @03:58PM
(#16199989)
Hint: Interpret the file’s bits as a single number
Re:A prime number whose binary representation looks like a g...
by qualitytime on Monday January 22, 2018 @04:11AM
(#16203005)
Thanks for the clarification.
Re:A prime number whose binary representation looks like a g...
by qualitytime on Sunday January 21, 2018 @07:05AM
(#16197772)
Was that a downvote? For asking a question? Jeez.
This particular one only looks like a giraffe when it's interpreted as a 1bpp big-endian bitmap, but you could probably do the same with a colour (24bpp, in whatever order you wish) photo.
Here's another fun idea: write a short program that checks if a file is a prime number. Now you can get into the principles of CRCs, RS, and other error-correction codes...