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

Premium Partners

Oa100px Softhouse100px Verisure 100x50 Odd hill 100x50 Tetrapak100x50 Advenica horisontal 100x50 Knightec100 Omegapoint100px Qlik100px Refined logo 100x50 Boozt 100x50 Mediaevolution100px Internetstiftelsen 100x50 Kan 100x50


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