I like the number guessing game, conceptually. Using this as a first example is especially rewarding in Python since it imposes so few syntax restrict

The Number Guessing Game Written in YAML as LISP Interpreted with Python

submited by
Style Pass
2022-01-23 16:00:09

I like the number guessing game, conceptually. Using this as a first example is especially rewarding in Python since it imposes so few syntax restrictions on its users.

Like the incomprehensible green letters in the Matrix, the source code with all its special characters like colons and parentheses looks like it came from another universe.

So, I tried to develop an even more straightforward way to introduce programming. Get rid of the data types, parenthesis and all this annoying stuff. Of course, I did not write a new language - and even if I did, it would not be very useful for everything else except teaching.

An often overused analogy to programming is that of a cooking recipe. And what does a recipe look like? Lots of bullet points, each indicating a step to perform. Sometimes, these bullet points are even nested, like so:

Doesn’t that look like YAML? Oh, I hear you! YAML is not a programming language, and, even more important: It is certainly not a good choice if one wants to get rid of complex syntax rules. However, I decided to give it a try. What if our number guessing game could look like this:

Leave a Comment