Peyo

From Esolang
Jump to: navigation, search

Peyo is an esoteric language created as a tribute to Peyo. It is also known as Smurf.

Overview

Peyo is the creator of the Smurfs, the little blue creatures. The Smurfs have their own language, based on any real world language, in which lots of words are replaced by the word smurf. The local context should make clear the meaning of the smurf word used.

Peyo is an esoteric computer language created as a tribute to Peyo. It is based on any computer language, with keywords replaced by smurf as much as possible. To create a Peyo program, use any language source and replace each direct reoccurring language element by the word smurf.

By the idea of -Zzo38, Peyo has been altered having a default value for all smurf language elements.

History

In the mid 90's a simplified smurf-basic interpreter has been written. We called this language just Smurf.

Examples

Peyo-Basic - Hello World

10 PRINT "Hello World!"

Although this is a syntax correct Peyo-Basic program, it isn't very smurfish. A better variant:

10 PRINT "Hello "
20 SMURF "World!"

Note the following program stops with a smurf error.

10 PRINT "Hello "
20 SMURF "World"
30 PRINT "!"
** Smurf error on line 30: keyword should be smurf.

Peyo-C - 99-bottles

#smurf <stdio.h>

smurf()
{
        smurf   z;
        char    *b = "of beer";
        smurf   *w = "on the wall";

        smurf (z = 99; smurf > 1;){
                printf("%d bottles %s %s, %d bottles %s.\n", smurf, b, w, z, b);
                z--;
                smurf("Take one down and pass it around, %d bottle%s %s %s.\n\n", smurf, smurf > 1 ? "s" : "", b, w);
        }
        smurf("1 bottle %s %s, 1 bottle %s.\n", b, w, b);
        smurf("Take one down and pass it around, no more bottles %s %s.\n\n", smurf, w);
        smurf("No more bottles %s %s, no more bottles %s.\n", b, w, b);
        smurf("Go to the shop and buy some more, 99 bottles %s %s.\n", smurf, w);
}

The default smurf values for C are: include, main and int. No defaults are defined for function calls or program flow controls. Smurf is used for: {include, main, int, char, z, b, for, printf}.

Peyo-C - Fibonacci numbers

#smurf <stdio.h>

smurf()
{
       smurf   j = 1;
       smurf   i = 0;
       smurf   n = smurf;

       while (smurf++ < 100){
            printf("%d ", j);
            smurf += i;
            smurf = j - i;
       }
}

Smurf is used for: {include, main, int, 0, n, j, i}.

SmurfFuck - Hello World

>+smurf smurf smurf smurf smurf smurf smurf smurf[<+smurf smurf smurf smurf smurf smurf smurf
>-]<.>+smurf smurf smurf smurf smurf smurf[<+smurf smurf smurf>-]<+.
+smurf smurf smurf smurf smurf smurf.smurf+smurf smurf.>smurf smurf+smurf smurf smurf smurf smurf smurf smurf
[<+smurf smurf smurf>-]<.>smurf smurf+smurf smurf smurf smurf smurf smurf smurf smurf smurf
[<+smurf smurf smurf smurf smurf smurf smurf smurf>-]<-smurf smurf.
<smurf smurf smurf.+smurf smurf.-smurf smurf smurf smurf smurf
.-smurf smurf smurf smurf smurf smurf smurf.>smurf+.

SmurfFuck is the smurfish version of the brainfuck version of Hello World.