Glucose++

From Esolang
Jump to navigation Jump to search

Glucose++ is an esolang that has "short syntax" for it to be accepted on this wiki and also be a esolang. Yeah, its glucose++ because we already gotR++.

data structures

nums: 1, 2, 3, -5, 9, 3.14 bools: true, false (these are the only) strings: "amogus", "cat", "bfisnoice", "DIAPER" lists: (1, 3.14, -5, "amogus", ("nestedarraywow")) lists are indexed from zero

commands

  • d()() defines a variable. example usage is: "d(username)("User")"
  • g() gets a variable.
  • ()+() is addition. It returns an integrer. Example usage is "(g(input1))+(g(input2))".
  • ()-(), ()*() and ()/() work the same with ()+(), but different operations.
  • s()() is the set command. to set a variable to something else, you can do this: "s(hunger)(100)" or "s(hunger)((g(hunger))+(1))".
  • =, <, >, ≤ and ≥ are valid commands that return booleans.
  • w()>() is the while loop, r()>() is a repeat loop (same as scratch), i()>() is the if statement, and an if/else statement is i()>()>!() is the else statement. sadly no else if :(
  • i gets input and returns it without needing g() and o() outputs a value.
  • => makes the datta for the next command run on the previous commands scope (if you use rli() => ... you can access to a deeper array, even you can go 2x deep with rli() => rli() => ...)
  • dl()() defines a lisr.
  • mli()() sets a list item to an value. to edit a nested array, you need somehing like "rli(idxofroot) => mli(idxtochange)(newvalue)"
  • rli() returns an list items value. also they are nestable to access spesific positions.
  • pus()() pushes to a list.
  • pop() removes a item from the list
  • gc()() gets a character from a string and returns it
  • asws()() appends a string with another string