PRINTASKSWITCHINPUTCASEXGOTOACASEYGOTOBELSEGOTOC

From Esolang
Jump to: navigation, search
This article is a stub, which means that it is not detailed enough and needs to be expanded. Please help us by adding some more information.

The PRINTASKSWITCHINPUTCASEXGOTOACASEYGOTOBELSEGOTOC programming language is an esoteric programming language by User:Rdococ, aimed at augmenting the Goto programming language with better I/O.

Structure

As the name of the language suggests, every instruction prints something, asks for input, and then checks the input in a SWITCH clause. Syntax goes a little like this:

PRINT "STUFF TO PRINT HERE." ASK SWITCH INPUT CASE "DERP" GOTO 2 CASE "HERP" GOTO 3 ELSE GOTO 1

And that's it. Programs are lines after lines of this same instruction with different parameters. Strings can only have capital letters to add to the feel of the language. Additionally, if the program tries to go to an invalid line number, it halts.

Computational Class

Like in Goto, lines of code in PRINTASKSWITCHINPUTCASEXGOTOACASEYGOTOBELSEGOTOC are like the states of a finite state machine.

Examples

Hello World

PRINT "HELLO WORLD!" ASK SWITCH INPUT ELSE GOTO 0

Very bad RPG

PRINT "YOU'RE IN A DARK ROOM MADE OF STONE. THERE'S A DOOR TO THE NORTH AND ONE TO THE SOUTH." ASK SWITCH INPUT CASE "GO NORTH" GOTO 2 CASE "GO SOUTH" GOTO 3 ELSE GOTO 1
PRINT "EVERYTHING FADES TO WHITE. I WONDER WHAT HAPPENED." ASK SWITCH INPUT ELSE GOTO 0
PRINT "YOU'RE IN A DARK ROOM MADE OF DIRT. THERE'S A DOOR TO THE SOUTH BUT NOT TO THE NORTH... HANG ON A MINUTE..." ASK SWITCH INPUT CASE "GO SOUTH" GOTO 4 CASE "GO NORTH" GOTO 2 ELSE GOTO 3
PRINT "YOU'RE IN A BRIGHT ROOM MADE OF GOLD! THERE'S A DOOR TO THE SOUTH AND A DOOR TO THE NORTH." ASK SWITCH INPUT CASE "GO SOUTH" GOTO 0 CASE "GO NORTH" GOTO 3 ELSE GOTO 4
PRINT "YOU'RE OUTSIDE! YOU WIN YAY! WHO CARES ANYWAY? YOU WERE IN A ROOM OF GOLD AND LOOK, THE DOOR'S GONE. YOU CANT GET TO THE GOLD. GREAT, NOW WHAT DO WE DO? I GUESS WE CANT DO ANYTHING... LET'S JUST GET HOME." ASK SWITCH INPUT ELSE GOTO 0