C-Shop

From Esolang
Jump to navigation Jump to search

C-Shop is an esolang created by User:None1, it has nothing to do with the non-esoteric language C# except that they have similar pronounciation.

Syntax

Every line in C-Shop can be one of these:

Welcome to C-Shop

This must be the first line of the program.

The big C costs $x

This must be the second line of the program.

X must be a decimal integer.

The small c costs $y

This must be the third line of the program.

Y must be a decimal integer.

Person X buys Y big C's and Z small c's

X is a positive decimal integer, while Y and Z just have to be non negative(can be 0), this will add the price of the C's to that person's total consume.

Person X will pay for his order

Print the total consume of the person in ASCII.

Ask price of the big C/small c

Read a char from standard input and replace the price of big C/small c with its ASCII.

Example Programs

One Time Cat

Welcome to C-Shop
The big C costs $0
The small c costs $0
Ask price of the small c
Person 1 buys 0 big C's and 1 small c's
Person 1 will pay for his order

Note that you cannot write an infinite cat program because C-Shop has no loop.

Hello World

Welcome to C-Shop
The big C costs $16
The small c costs $1
Person 1 buys 4 big C's and 8 small c's
Person 1 will pay for his order
Person 2 buys 6 big C's and 5 small c's
Person 2 will pay for his order
Person 3 buys 6 big C's and 12 small c's
Person 3 will pay for his order
Person 3 will pay for his order
Person 4 buys 6 big C's and 15 small c's
Person 4 will pay for his order
Person 5 buys 2 big C's and 0 small c's
Person 5 will pay for his order
Person 6 buys 5 big C's and 7 small c's
Person 6 will pay for his order
Person 4 will pay for his order
Person 7 buys 7 big C's and 2 small c's
Person 7 will pay for his order
Person 3 will pay for his order
Person 8 buys 6 big C's and 4 small c's
Person 8 will pay for his order
Person 9 buys 2 big C's and 1 small c's
Person 9 will pay for his order

Interpreter

  • Common Lisp implementation of the C-Shop programming language.

See also