Life So Short, the Craft So Long to Learn

Play Schnapsen in Your Browser

Schnapsen is an excellent card game for two players. Quite a few years ago we wrote an iOS app in OCaml to play the game. More recently we revamped it as an app that runs in the browser—reproducing the graphics exactly, in a rectangle with the pixel dimensions of the original iPhone.

One of the great things about OCaml and its strong static typing is that you can make modifications to your code with high confidence that it will keep working correctly. It was quite pleasant to rewrite the iOS app for the browser environment. Naturally the code for playing the game (the “game engine”) didn’t change at all in the rewrite.

Schnapsen is like a miniaturized version of Pinochle, using a deck of only 20 cards. This makes it easier to master than games with more cards. But it’s still challenging to master fully. If you’re new to the game, there’s a Suggest button that makes it easy to get up to speed. It’s like having an expert player to give you advice.

Play Schnapsen (Free)
More Information on the Game

The Schnapsen Log

The Schnapsen Log is a series of columns about the card game Schnapsen, and how to play like a master. It’s even more like having an expert player to give you advice!

Recent columns:

Sidestep a Few Landmines, Sep 2
Two Last-Trick Problems, Jun 27
More Extremes of Luck, May 21
Grasping at Straws, Apr 4
A New Scheme for Remembering Cards, Mar 23
As Luck Would Have It, Sep 9

Visit the Schnapsen Log

Play Cassino in Your Browser

Our first OCaml app for iOS played the classic card game Cassino, and we have revised it as a webapp also. The graphics are exactly the same as in the old iOS app. You compete against the app in your browser to see who can capture the most points.

The Cassino app plays three variants of the game. Two variants follow traditional scoring to 21. The third has simplified scoring, for faster and more casual games—good when you’re standing in line for a latte.

Play Cassino (Free)
More Information on the Game

OCaml Programming

For many years we have been happy users of the functional programming language OCaml. We used the Js_of_ocaml OCaml compiler to create the two webapps above. It was surprisingly easy to transport the iOS OCaml code to the browser environment.

Of course we also used OCaml to create the original Schnapsen/66 and Cassino apps for iOS. Although the work is old by now, we’re still hosting the pages for the OCaml-to-iOS compilers that we came up with, and for a set of example programs. Given an up-to-date OCaml-to-iOS compiler, it might be possible for a motivated programmer to resurrect the example programs.

OCaml on iOS

Portland Example App Slide24 Example App Icosablue Example App

Our pages of resources for OCaml programmers showed how to build an OCaml cross-compiler for iOS devices, and how to build an OCaml interface to the iPhone’s OpenGL ES graphics system.

We also have source code for three working example OCaml iOS apps that were packaged to run on iOS devices, Portland, Slide24, and IcosaBlue. The first two show how to use Cocoa Touch from OCaml, and the third shows how to use OpenGL ES.

OCaml on iOS Simulator

Gamut Example App Voronoi Example App Icosablue Example App

The OCaml pages also showed how to build an OCaml compiler for the iOS Simulator, and we have source code for two example apps that were packaged to run in the iOS Simulator, Gamut and Voronoi. In addition, we packaged the IcosaBlue app (described above) for the Simulator as well as for iOS devices.

iOS Development

While porting OCaml to iOS devices and working on our apps, we learned some out-of-the-way things about iOS and iOS development. We wrote them up on the iOS Development page in case they’re useful to other programmers.

Psellos Blog

One of us (Jeffrey) writes an extremely sporadic blog about what we’re doing at Psellos.

Recent posts: