Let's start at the beginning. I was exploring the internet (as you do), and eventually landed on a site called The Library of Babel. Right now, it contains "all possible pages of 3200 characters, about 104677 books". Looking deeper, I also found The Canvas of Babel, which is "an infinite array of every possible arrangement of pixels".

After The Canvas of Babel, I was thinking it would be cool if the TI-84 Plus CE had a similar program. However, I wanted it to be in order, so it can be smaller and not rely on a PRNG to operate correctly. So I created this program, "The Color of Babel".

With over 32,768 combinations per pixel (but my program goes through 65,536) and 76,800 pixels, the final combinations would be 3276876800 or about 3.589259895016700... × 10346786 combinations, which is a very big number. Even though no one will probably reach it, this program shows every picture that does and will exist on the calculator, including the first response to this post, the next winning lottery numbers, and a graphic explaining the solution to cold fusion.

This is just a small (~630 bytes), silly program, and really for me to learn how to use the LCD. The source code is on Github, so feel free to find and implement any optimizations that I couldn't see.
Neat, but your program doesn't work the way you think it does. You are writing to the LCD in 16bpp.mode but you are also using the graphx library which configures the LCD in 8bpp mode, so you are only selecting from 256 colors per pixel (and writing two pixels at once).

Also the way you are reading keys is completely wrong. Have you looked at any of the examples?
Quote:
You are writing to the LCD in 16bpp.mode but you are also using the graphx library which configures the LCD in 8bpp mode, so you are only selecting from 256 colors per pixel.

See, this is exactly what I wanted to learn! I want to first clear the screen,which is why I used the graphx library and gfx_ZeroScreen();. What would be a good and fast implementation of this without using graphx? Would it be something like memset((void*)lcd_Ram, color, LCD_SIZE);?

Quote:
Also the way you are reading keys is completely wrong. Have you looked at any of the examples?

I know the pausing is kinda scuffed, and probably will be removed. But for the exiting, I wanted the only button that can end the program to be the Clear, and I created a macro header that is used in conjunction with keypadc (Keys.h, which I just added to the src folder on the Github page). If I remove the pause function, I can move the exit key checking to the do-while loop.
Yeah using memset would work fine for this case.

You should probably also use size_t rather than uint32_t because 32-bit types are slower.

You should also create a new uint16_t pointer you use to access the LCD:

Code:
`uint16_t vram = lcd_Ram;`

Also make sure you are using the latest toolchain
Thank you Mateo. I have update the Github page with the new code (now 475 bytes!), using what you told me.

Though I do have the feeling that someone could use assembly and ultra-compact it to less than 50 bytes.
Your wish is (almost) my command.
https://github.com/imclevor/canvas-of-babel-ce

Edir: A one-letter program name on the calculator would be 54 bytes, but it is 120 bytes on the computer.

Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

»
» All times are UTC - 5 Hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum