Whimsyx

From Esolang
Jump to navigation Jump to search

Whimsyx is by User:Esolangist and Microsoft Copilot.

Commands

Control flow and misc.

The sun rises ____ - starts the program

The stars align (x) - Jumps to line x

The echo fades _____ - EOF

Time dances while (x) - Repeat x times...

The clouds weep if (x) - If statement.

But the sun smiles - Else.

But the sun smiles and the clouds weep if (x) - Else if.

The tide returns - Return from a repeat or if. Can be used to break out of the loop or as } in JavaScript.

The fog lingers (x) - Wait for x milliseconds.

What the moon listens - Input as string.

The stars whisper (x) - Output.

What the mirror seeked - Input as number.

Math

Mountains rise near (x) and (y) - x + y

Rivers carve valleys near (x) and (y) - y - x

Lightning strikes (x) times near (y) - x * y

Raindrops scatter near (x) and (y) - y / x. If x is 0, output "The stars align to make a constellation: It looks like a raindrop, then it changed to the number 0."

Mirrors reflect (x) and (y) - x == y

Shadows stretch long, further than (x) but closer than (y) - x > y

Leaves fall gently, revealing (x) and (y) - x < y

Variables

Variables have to be names of planets.

(x) remembers (y) - Set x to y.

(x) forgets (y) - Set x to y, and delete y.

What (x) recalls - x.

Advanced math

Galaxies collide, with (x) and (y) left - x ^ y (^ is exponents)

Nebulae dissolve, including (x) and (y) - x % y (% is modulo)

The edge of the universe - Infinite

Functions

This section is still a work in progress. It may be changed in the future.

writing later

Examples

Hello, World!

The sun rises over quiet hills.
The stars whisper "Hello, World!"
The echo fades, what if it was a dream?

Factorial

This section is still a work in progress. It may be changed in the future.

This example is WIP.

The sun rises on grassy hills
Venus remembers what the mirror seeked
The clouds weep if the leaves fall gently, revealing what Venus recalls and 2:
 The stars whisper 0
todo: add more

Cat

The sun rises on dark sea
Time dances while the edge of the universe:
 Mercury remembers what the moon listens
 The stars whisper Mercury
The echo fades, everything normal again