Sickfrog

From Esolang
Jump to navigation Jump to search

Sickfrog is an esoteric programming language created by Stysan (talk) that commands are based on Frog commands. Syntax of this language is based on Batch syntax. Sickfrog scripts extension is .sfrgp. This language is remake of Frog programming language.

Commands
Example Output Description
cr Hello World! Hello Outputs first 5 letters of a value without new line, bc frog is sick.
qu How old are you? How o Asks a question (first 5 letters of value).
ri 14 No output What question answer should be. Full value.
bark True/False Checks if answer is right. Full value.
beep 10 1-10 Outputs a random number between 1 and entered value. Full value.
cluck 1 No output Sleeps value seconds. Full value.
nl \n Outputs a new line.
*something No output Comments.

Interpreter

This is the original interpreter for Sickfrog written on Python 3.8.5.

from tkinter import Tk, filedialog as fd
from time import sleep
from random import randint

tk = Tk()
tk.withdraw()

filetypes = [("Sickfrog Scripts", "*.sfrgp"), ("All files", "*.*")]
code = fd.askopenfilename(title="Select a Script", filetypes=filetypes)
code = open(code, mode="r")
code = code.read()
code = code.split("\n")

answer = ""
answer_shouldBe = ""

def bug():
    print("ERROR")
    sleep(1)
    quit()

for i in code:
    try:
        if i.startswith("cr "): print(i[3:8], end="")
        elif i == "nl": print()
        elif i.startswith("qu "): answer = input(i[3:8])
        elif i.startswith("ri "): answer_shouldBe = i[3:]
        elif i == "ba": print(answer == answer_shouldBe)
        elif i.startswith("be "): print(randint(1, int(i[3:])))
        elif i.startswith("cl "): sleep(int(i[3:]))
        elif i == "" or i.startswith("*"): pass
        else: bug()
    except: bug()

Examples

Hello World!

cr Hell
cr o Wor
cr ld!

Quiz!

cr Quiz!
ri esolangs.org
cr What 
cr is th
cr e bes
cr t sit
cr e abo
cr ut es
cr esola
qu ngs?
bark
cr I won'
cr t add
cr  more
cr  ques
cr tions
cr I'm l
cr azy

See also