In the end, I was able to implement these features:
- Integer variables (single letter) and literals Variable assignment
- Arithmetic with + - * % with precedence (unary + - only works at the beginning of an expression)
- Comparisons with < > <= >= == (only one per expression)
- Integer truthiness
- if and else
- while loops, including else blocks
- for x in range(y) loops, including else blocks
- Function definitions with no arguments
- Function calls, even recursive
- Indent-based blocks (without scope)
- print with a single string literal or integer expression
- Comments
"Si tous les cons volaient, il ferait nuit" F. Dard
# Le code "golfé"
Posté par Luc-Skywalker . En réponse au lien Making a Python interpreter in 1024 bytes. Évalué à 3 (+1/-0).
https://en.wikipedia.org/wiki/Code_golf
"Si tous les cons volaient, il ferait nuit" F. Dard