stephenfmann / cooking-with-python

Chef esolang interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cooking with Python

About

What is this?

A Python interpreter for the esolang Chef.

What is Chef?

Not the configuration management tool (boring) but the esoteric programming language (archived link) (wow!)

What is Python?

A less esoteric programming language. I'm using version 3.7+.

Did you do this all yourself?

No, I adapted it from a mysterious unknown author.

Also check out Dorlsch0's Python interpreter and joostrijneveld's Java interpreter.

Run

import chefint
c = chefint.Chef("<Your Chef Script>")
output = c.parse()

Or run the script from shell with argument <filename> which contains the Chef script.

Examples

Several examples can be found in the recipes/ directory, including:

helloworld.chef

from David Morgan-Mar (archived link)
This recipe prints the immortal words "Hello world!", in a basically brute force way. It also makes a lot of food for one person.

fibonacci.chef

from David Morgan-Mar (archived link)
This recipe prints the first 100 Fibonacci numbers. It uses an auxiliary recipe for caramel sauce to define Fibonacci numbers recursively. This results in an awful lot of caramel sauce! Definitely one for the sweet-tooths.

cherrypi.chef

from me!
Calculates the value of pie to an arbitrarily delicious degree of accuracy. You start with 1, 2 or 3 cherries; the more you add, the more deliciously accurate the pie will be. For every four cherries you use, your pie will gain about three more delicious decimal digits - that is, it will be approximately one thousand times more delicious.

About

Chef esolang interpreter

License:The Unlicense


Languages

Language:Python 100.0%