We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Compaline

From Esolang
Jump to navigation Jump to search

Compaline is an esoteric programming language, invented on 19 October 2023, by Ice Bird. Its name is a portmanteau of "comparison" and "timeline", which a reference to several removed YouTube videos made by JG Science. The commands are references to the comparison and timeline videos and their removal.

Tutorial

Modules

Compaline has several built-in modules for various purposes. To use a module, you need to add "Watch <module name>" for each module. Module list: - information, used for any sort of interaction or communication with users.

   information.upload(<message>) - Sends the message in between the parantheses.
   information.recover.title(<variable>) - Receives text input in between and assigns it to the variable in between the parantheses.
   information.recover.thumbnail - Receives keyboard input.
   information.recover.play - Receives mouse input.

- probability, used for returning random numbers or items. (similar to random module in python)

   probability.integer(<x>, <y>) - Returns a random integer between x and y inclusive.
   probability.real(<x>, <y>) - Returns a random real number between x and y inclusive.
   probability.item(<list>) - Returns a random item from a list.

- number, used for advanced mathematical operations and functions.

   number.high(<list>) - Returns the variable with the greatest value from a list. List can be either a variable or an array of items separated by commas.
   number.low(<list>) - Returns the variable with the lowest value from a list. List can be either a variable or an array of items separated by commas.
   number.sin(<number>) - Returns the sine of a number of radians. For degrees, use number.sin.deg.
   number.cos(<number>) - Returns the cosine of a number of radians. For degrees, use number.cos.deg.
   number.tan(<number>) - Returns the tangent of a number of radians. For degrees, use number.tan.deg.
   number.cot(<number> - Returns the cotangent of a number of radians. For degrees, use number.cot.deg.
   number.factorial(<number>) - Returns the factorial of a number.
   number.sum(<list>) - Returns the sum of all items in a list. List can be either a variable or an array of items separated by commas.
   number.product(<list>) - Returns the product of all items a list. List can be either a variable or an array of items separated by commas.
   number.lcm(<list>) - Returns the least common multiple of all items in a list. List can be either a variable or an array of items separated by commas.
   number.gcd(<list>) - Returns the greatest common divisor of all items in a list. List can be either a variable or an array of items separated by commas.
   number.approx(<number>) - Returns the number rounded to the nearest integer.
   number.before(<number>) - Returns the first integer less than or equal to the number.
   number.after(<number>) - Returns the first integer greater than or equal to the number.
   number.positive(<number>) - Returns the absolute value of the number.
   number.sqrt(<number>) - Returns the square root of the number.
   number.cbrt(<number>) - Returns the cube root of the number.
   number.power(<list>) - Returns the exponentiation of all items in a list, i.e. x^y^...^lastnumber. Usually only used with 2 numbers. List can be either a variable or an array of items separated by commas.

- time, used for time detection and management.

   time.elapse(<seconds>) - The code stops running for <seconds> seconds.

Example

To play Rock Paper Scissors:

 Watch probability
 Watch information

 probability.integer(0, 2)
 if 0 is recovered: archive rock
 if 1 is recovered: archive paper
 if 2 is recovered: archive scissors
 comparison_1(download archive)
 information.upload(Choose rock, paper, or scissors.), comparison convert to information.recover.title
 archive comparison
 comparison_2(download archive)
 if information.recover.thumbnail == Q: terminate
 if nostalgia(comparison_1, comparison_2) identical: information.upload(It's a draw!)
 if (comparison_2 == paper and comparison_1 == rock) or (comparison_2 == scissors and comparison_1 == paper) or (comparison_2 == rock and comparison_1 == scissors): information.upload(You won!)
     lost: information.upload(You lost!)