X(?)

From Esolang
Jump to navigation Jump to search

X(?) is an entirely probabilistic Esolang while one type command is present: ?(?), this command does a random thing from a list of commands and feeds in random parameters, listed below are all functions given a command.

Parameter generation

Parameters are either randomly generated (denoted by a ?) or by another function nested in the function. When generating, the following conditions are always met:

  • It is the correct type
  • If string:
    • Will generate a random string of ascii characters between 1 and 21 characters long
    • Said Ascii values range from 32 to 100.
  • If integer:
    • Will generate a random integer between -441 and 441
  • If floating point number:
    • Same processes but adds random decimal digits. No more than 3 decimal places.
  • If boolean:
    • Ok do I have to explain its just either true or false.

Commands

X(?)

X(?) is a bunch of modification to the parameter or output function, as listed:

  • Output the given parameter as number
  • Output given parameter as ASCII character
  • Increment the given parameter by 1
  • Decrement the given parameter by 1
  • Square the given parameter
  • Returns whether the parameter given is positive or not.
  • Returns the parameter
  • Negate parameter

H(?)

H(?) Is a bunch of random small snippet programs that people generally use (that being ones from HQ9+), these ones are slightly affected by the parameter, non booleans are just set to false:

Functions:

M(?,?)

Mathematical operations, functions listed below:
(If A is parameter 1 and B is the other one)

  • A + B
  • A - B
  • A * B
  • A / B
  • A % B
  • A in base B
  • A ^ B
  • A root B
  • Checks if A > B
  • Checks if A < B
  • Checks if A = B

(For last 3, return true or false depending on if condition met)

I(?)

I(?) is the only way to get input aside H(?), and there are only two functions.

  • If parameter is true, Cat program and acts like a random parameter.
  • If parameter is false, Store the input given
  • If none of the above are true, It does both.

K(?)

K(?) is a list of unary math operations, listed below:

  • Square parameter
  • Cube parameter
  • Sqrt parameter
  • Cube root parameter
  • Parameter factorial
  • Round Parameter

E(?)

E(?) Corrects any potential errors in an program. And returns error otherwise If parameter is a random, Do one of the following:

  • Return an Error
  • Warn the user with a random string message
  • Provide unhelpful information about the program
  • Act like a regular print statement for a random string


Q(?)

Flow control that acts like this:

Start the controlled part with a C(
End the controlled part with a ?)

Q(?) does:

  • For loops ( Do amount of times as parameter )
  • While loops ( Do while condition true )
  • If (Do if condition true)
  • Forever (Do forever!!!!)

S(?)

Switch case statement, works like this:

W[?]C( Will start a case with a random value
?) Ends a case

The given case is a random valid case in the whole thing.

Programs

Random HQ9+ one-command program

H(K(?))

Gets input and hopefully does a random calculation

E(X(M(I(?),I(?))))