When

Show off your games, demos and other (playable) creations.
Post Reply
duaner
Prole
Posts: 41
Joined: Thu May 07, 2020 6:43 pm
Contact:

When

Post by duaner »

This displays a when (http://www.lightandmatter.com/when/when.html) calendar on android. It's probably not useful if you've never heard of when, but you might be interested in the source code. I put in a tokenizer that doesn't use regular expressions, and the calendar math is done in reverse-polish notation, converted from infix read from the calendar file. It also has a simple, scrolling window.

The when.lua file will display a when calendar in a terminal when run with the lua interpreter, though it has none of the configuration you get with the actual when.

When turns calendar descriptions like this into lists of events by day:

Code: Select all

1912* apr 9 , Uncle Fester's \a birthday
!(j%16-2) , Haircut 
m=jan & w=mon & a=3 , Martin Luther King Day
* feb 14 , Valentine's Day
You modify the calendar file with any text editor. There's no easy way to do it from android -- it's just for display.

There's a lot of room for improvement in this code -- I still haven't accounted for line wrapping, so the window is usually too small. I haven't implemented the easter variable yet. I might even make it editable some day.
Attachments
when.love
(223.4 KiB) Downloaded 101 times
screenshot.jpg
screenshot.jpg (68.23 KiB) Viewed 5112 times
Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests