We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

User:Nights192/Magritte

From Esolang
Jump to navigation Jump to search

This is an interpreter for Magritte.

##Programmed by Robert H. Hofrichter, 2011.##
import os
import cStringIO
import sys

mode = raw_input("Is this program in 'file' or 'terminal' mode?\n")
if mode == "terminal":
    while 12 > 11:
        cmd = raw_input(">")
        if cmd == "Ceci n'est pas un programme.":
            print "Ceci n'est pas un programme."
        else:
            print "Error: Program is invalid."
if mode == "file":
    mfile = raw_input("Please enter the file to run.\n")
    if os.path.exists(mfile):
        if open(mfile) == "Ceci n'est pas un programme.":
            print "Ceci n'est pas un programme."
            raw_input("\n")
    else:
        print "Error: File does not exist."
        raw_input("\n")