Язык 7 миллиардов людей
GHub Platform · Гайд · 0 ответов · 1 просмотр

Tiles Empty tile - Does nothing special Printer - Data cubes with a random number between 0 and 99 can be taken from the printer. Shredder - Shreds anything given to it. Wall - Stops worker movement. Hole - Workers can fall into it when trying to step on it. Plants / Furnitures - Act like walls, but workers can't detect them. Boss - Your boss acts like a Furniture occupying 4 tiles. Sensor - Scans it's tile Button - When stepped on, activates all sensors and sends their data to the Counting Machine Display. Counting Machine Display (as officially named) - A furniture that displays an integer in base 10. Cannot be read by workers. Neighbouring tiles Most commands interact with the 8 neighbouring tiles that are next to the worker vertically, horizontally, and diagonally. Scanning When a worker is told to check a neighbouring tile then the tile needs to be scanned which takes time. However, multiple tiles can be scanned simultaneously. Politeness behaviour: Workers may wait for workers doing their thing while scanning their tile. Memory slots From year 25, the workers now have accessible memory consisting of 4 slots that can be written and read, and used as a parameter in nearly every command. Memory slots use all data types and are initialized to the integer "0". Data types The programming language in 7 Billion Humans uses the following data types: Nothing (Note that "nothing" == "nothing" and "0" == "something") 32 bit signed integer ranging from -2147483648 to 2147483647 Data cube reference - This is a reference to the data cube itself, (like in object oriented programming) not a snapshot of the data cube. If someone changes the number on the data cube, this memory slot will also change. If the data cube is destroyed, it is replaced with "nothing". Worker reference - Like with data cubes, workers can also be remembered. This can be used to remotely read the data cube they are holding. Worker/Data cube dual reference - When a worker scans a tile that has a data cube on it, but also another worker, it memorizes both. Read operations interact with the Data Cube reference, except that the slot is also "== a worker" Printer - The data cube on top of the printer cannot be read. Shredder Sensor Button Pathfinding If a memory slot is used as a parameter for a physical command, pathfinding will be used. All physical commands except write and drop support pathfinding. Workers prefer to avoid other workers while pathfinding. Code blocks are the main components of the code. They have 4 variants. Physical operations Physical operations are the most important operations. Without them, workers do nothing. Steps onto a neighbouring tile. If the targeted tile is occupied by a worker then this command will wait until the tile is free. Trying to step on a wall tile or office appliance has no effect. As of Year 29, memory slots can be used to pathfind to a memorized object. Pathfinding to a wall, another worker, or office appliances will try to go as near them as possible. As of Year 30, multiple neighbouring tiles can be specified to make the worker chose one randomly. Politeness behaviour: If two workers try to walk to eachother's tile, they will swap. Workers who finished executing their code always swap with workers trying to step on their tile. Picks up something from the tile the worker is standing on. Throws soft exception if there is nothing to pick up. As of Year 7, workers can also pick up something from a neighbouring tile. As of Year 25, memory slots can be used to pathfind to an object and pick it up. (This also steps on the object.) Politeness behaviour: If the NEAREST command was used to find the data cube, the worker may switch target (to another data cube) if said cube is taken while walking to it. Note that "PICKUP MEMX" is always equivalent to "STEP MEMX; PICKUP C" except for the additional politeness behavior and different soft exceptions. Drops the data cube the worker is holding onto the tile the worker is standing on. Throws a soft exception if there is nothing to drop, or if there is already a data cube on the tile. Gives whatever the worker has to a neighbouring office appliance or another worker. Giving to a worker will temporarily pause their execution. If a direction is specified, it needs to be scanned for an object first. This throws a soft exception if trying to give nothing to a worker or printer, or if a targeted worker is already holding something. As of Year 25, memory slots can be used to pathfind to an object and give to it. Attempts to acquire a data cube from a neighbouring office appliance or another worker. Taking from a worker will temporarily pause their execution. If a direction is specified, it needs to be scanned for an object first. Throws a soft exception if the worker already has a datacube. As of Year 25, memory slots can be used to pathfind to an object and take from it. Writes a specified memory value to the data cube the worker is holding. If the memory slot does not contain a number then 0 is written. Throws a soft exception if the worker does not hold anything. Threading operations Threading operations affect the way each worker reads the code Jumps to a specified line in the code. Can be used to jump forward to skip sections, or backwards to create loops. The IF block is the only way to branch the code. Commands in the IF block will only be executed IF the conditions specified on the IF command are true. When a worker executes an IF block, it first scans all necessary tiles, then evaluates the conditions. If no tiles need to be scanned, the IF command takes no time to execute. Within the same IF command, multiple conditions can be specified and it will still count as one command towards the size challenge. Each condition can have the following mathematical operations on a given reachable tile: == equal ≠ not equal > greater than >= greater than or equal < smaller than <= smaller than or equal With multiple conditions, logical operations must be used: AND - The previous conditions AND the next line must be true. OR - The previous conditions OR the next line must be true Note that operations don't have priority over each other, so they will always be evaluated in order from top to bottom. So A AND B OR C AND D is simply ( ( (A AND B) OR C) AND D) . After the IF block, an optional ELSE block can be created. The else block is executed IF the condition was evaluated to false. This however does count as another command. Using JUMP to jump into a block does not check the condition for the block. As of year 21, the data cube the worker is holding can be queried. As of year 25, memory slots can be queried. Ends the execution of the worker. The ForEachDir loop runs for every specified direction placing the object at that direction into the specified memory slot as if it was read by SET. The directions are iterated in clockwise order as the image shows on the right. Note that JUMPing into a ForEachDir block from the outside will start the loop and sets the specified memory slot to the first object. Memory operations Memory operations are performed on memory slots. A specified memory slot can be set to the value they return . Can be set to... ...return a specific value. ...return the value of a specific memory slot. ...scan a reachable tile and return the result. Returns an object of a given type that requires the least walking to get to. (Diagonal steps are considered slightly longer than horizontal and vertical steps.) Performs an arithmetic operation on two values. Since the workers can not do mental arithmetic, they use a calculator that is very slow. They can add, subtract, multiply and divide. Synchronization These code blocks deal with synchronization, that is, help workers time certain tasks together. Tells a specified message to the specified co-worker(s). A neighbouring tile can be specified, everyone" can be
ИсточникGHub Platform · автор13.09.2026, 23:19:50
Tiles Empty tile - Does nothing special Printer - Data cubes with a random number between 0 and 99 can be taken from the printer. Shredder - Shreds anything given to it. Wall - Stops worker movement. Hole - Workers can fall into it when trying to step on it. Plants / Furnitures -…
Войдите, чтобы писать в группе