Thursday 24 May 17:30

TypeScript and crossing the river

After work Seminar


Have you ever heard of that puzzle where a farmer wants to cross a river with a fox, a goose, and a bag of beans? He has a boat, but he can only fit himself in the boat plus at most one of the three items he bought: the fox, the goose, or the bag of beans. (Don't ask me why he bought a fox. I have no idea. Probably an impulse purchase.)

The fox really wants to eat the goose, and will at the first opportunity when it's left alone with it. Similarly, the goose is eyeing the bag of beans, and will gobble it up if unsupervised, even though it has promised to give up beans for lent. If anyone eats anything, the farmer loses and you don't solve the puzzle. The goal is to take all three items across the river unscathed.

It's a cute puzzle, and there are two solutions — neither is too hard to find. But one day I thought, hey, why not write a program that searches for a solution? You feed it the rules of the puzzle, and it just comes up with a way to take the items across. Like magic! You can input various other puzzles too, and it'll solve them too.

This talk is the story of how I wrote that program in modern JavaScript, and how halfway through it I realized it would be so much better if I switched to using TypeScript.


Carl Mäsak is an avid developer who considers himself "full-stack" because he can program both the Turing Machine and the Lambda Calculus. He lives in Malmö with his wife and child, although long-term they are thinking of moving to Mars.


17.30-17.45 – Meet & Greet

17.45-18.30 – Presentation

18.30-19.00 - Break with pizza

19.00-20:00 - Q & A

Brought to you by:

Platinum Partners

Capish100px Axis100px Connectitude100px

Premium Partners

Mediaevolution100px Qlik100px Verisure100 Softhouse100px Oa100px Securelink100px Omegapoint100px Advenica horisontal 100x50 Tetrapak100x50 Knightec100 Kan 100x50 Boozt 100x50 Internetstiftelsen 100x50


Handelsbanken100px Thirdbase100px U blox100px Yrkesorange100px Tedkomp100px Stratiteq100pxbl Crosstech100px Purplescout100px Playtechbgt100px 24hr100px Schneider100px Tieto100pxnew Hotnew100px Ifacts logo partner 100px Odd hill 100x50 Terranet100px Bimobject100px Essiq100px Falconio100px Aveva 100x50 Humanit100px Avensia100px Relax100px Cybercom 100x50 Hittahem small Raygun100px Edument100px Pinmeto100px Livingit100 Lime color 100x50 Storytel100x50 Additude100x50 Q100x50 Nilex100x50 Upptec 100x50 Infotiv 100x50
Sign in