Book Reader -- The Pig and the Box

I’ve made a portable book reader that creates executable books. It compresses the text but still because of the limited flash size only small books will fit. Here is one such book (it’s a short CC0 public domain children story):

book_arduboy_pig.hex (36.2 KB)

screenshot2

Here is the source code, it’s all CC0:

If you want a book compiled and can’t (you have to run some Python scripts), suggest it in the comments and I will add it, just keep in mind it can’t be much longer than this one.

EDIT:

Coincidentally this fits the game jam I didn’t know about, so I added it as an entry, but keep in mind I made this mostly as an experiment, not a competitive jam entry :slight_smile:

7 Likes

Great idea … I wonder why you didn’t enter it in the Jam? Had you started it earlier??

TBH I didn’t know about the jam, I wasn’t active lately. I’ll take a look at it, but from the Arduboy perspective this is really a pretty simple program, the only nontrivial thing it does is decompress the text – it’s more of an experiment than a killer app meant to compete with others. But there’s nothing to lose I guess :slight_smile:

EDIT: Okay, I did it, at least there is more entries I guess.

Excellent work!

In case anyone’s having problems with running process.py:

Add the following to the includes:

import os
import shutil

And then replace:

subprocess.call(["rm", "-rf", "output"])
subprocess.call(["mkdir", "output"])
subprocess.call(["cp", "main_" + platforms[PLATFORM][2] + "." + platforms[PLATFORM][2],"output"])
subprocess.call(["cp", "core.h","output"])
subprocess.call(["cp", "data.h","output"])
subprocess.call(["cp", "font.h","output"])
subprocess.call(["cp", "platform_" + PLATFORM + ".h","output"])

At the bottom with:

if os.path.exists("output"):
  os.rmdir("output")

os.mkdir("output")
shutil.copy2("main_" + platforms[PLATFORM][2] + "." + platforms[PLATFORM][2], "output")
shutil.copy2("core.h", "output")
shutil.copy2("data.h", "output")
shutil.copy2("font.h", "output")
shutil.copy2("platform_" + PLATFORM + ".h", "output")

Personally I also had a few unicode issues,
so I replaced the unicode quotes and elipses with their ASCII equivalents.

Also don’t forget to rename output to main_ino.ino or main_ino.ino to output.ino.

Personally I’m not a big fan of the pig book, I much preferred some of the other titles.
If I were reviewing the actual book, it would be a pretty damning review.

2 Likes