Contemporary Development With Functional Programming

Play Schnapsen in Your Browser

Schnapsen is an excellent card game for two players, and Master Schnapsen/66 was an iOS app that we wrote in OCaml to play the game. We’ve recently revamped it as an app that runs in the browser—reproducing the graphics exactly, in a rectangle the size of the original iPhone. Our app plays at three levels; at the Master level it’s a formidable opponent.

Schnapsen is like a miniaturized version of Pinochle, surprisingly easy to play well but 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)
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:

As Luck Would Have It, Sep 9
What's in the Stock?, Dec 5
Schnapsen in Abstract Games Magazine, Oct 24
Know Your Opponent, Sep 19
Grab the Brass Ring, Jul 3
The Last Trump, Jun 11

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)
Information on the Game

OCaml Programming

For many years we have been happy users of the functional programming language OCaml. We used the Bucklescript 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 somewhat out of date, we’re still hosting the pages for the OCaml-to-iOS compilers that we used, 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: