by rrradical · 12y ago · 0 comments
I needed a lisp to manipulate the puzzles, because they aren't based in a strict grid. It ended up being way more natural to program the block structures as lists rather than traditional matrices.
Gambit compiles the Scheme code down to C, which I can then link to Objective-C for iOS, or port to Android or any other platform that Gambit supports.
If you like I can e-mail you in the future when the article is out. There's contact info on my website: http://asivitz.com/cloudbreaker/
I'd love to be able to do this with ECL (http://ecls.sourceforge.net/) to build apps in common lisp for iOS (possibly android). I know about MOCL, but I'm a pretty cheap guy, so would rather stick to open technologies and do the work myself.
I'm not a scheme guy, but until you get a writeup done, would you mind posting any info you have on interfacing gambit with iOS?
Good work, and thanks for sharing!!
http://kriyative.github.io/tags/
I vaguely remember someone adapting it with an ECL to android cross compilation effort. Can't find that link now.
The LGPL license of ECL is something to keep in mind as you consider your options.
Good luck.
It's definitely not a 10 minute process, but shouldn't be too hard.
I think I also remember some projects popping up the Gambit mailing list to make all of this easier. It might be worth searching the archives.
((0 (73 84 92)) (1 (17 95 31)))
Where the 2 digit numbers are id numbers for the blocks. The single digit number to left of each row is the horizontal offset.
So, shifting a row, the most elementary operation in the game, just requires incrementing the offset.
Vertical shifts are done with a 90 degree rotation operation, then a horizontal shift, then a -90 degree rotation.
Sometimes traversing the lists is necessary, but the most common operations are fast, and then rest are fast enough.
The limiting factor in performance is definitely rendering, not the game logic.
The library situation in Gambit is.... very bad. Last time I tried it (~6 months ago) you had to compile from a different branch to get Blackhole to work.
Chicken Scheme has a much better ecosystem. It also compiles to C and is fast. Gambit is known for its speed so I won't say Chicken is as fast but it is "fast enough" and the ecosystem is worth the difference IMO.
It was somewhat tricky to get it all setup, but I followed in the footsteps of James Long (http://jlongster.com/s/jlongster-old/pages/blog/write-apps-i...) and a few others.
I hope to contribute back what I learned and make it easier for others to use it for games in the future. It's seriously a great language for game writing.
There's a basic explanation of the method in another comment I've written here though.