Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions EN/Strings/code_tooltips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Makes the drone do a flip! This action is not affected by speed upgrades.

returns `None`

takes 1s to execute.
takes `400` ticks to execute.

example:
`while True:
Expand All @@ -198,7 +198,7 @@ Pets the piggy! This action is not affected by speed upgrades.

returns `None`

takes 1s to execute.
takes `400` ticks to execute.

example:
`while True:
Expand All @@ -209,7 +209,7 @@ Multiple values can be printed at once.

returns `None`

takes 1s to execute.
takes `400` ticks to execute.

example:
`print("ground:", get_ground_type())`
Expand Down Expand Up @@ -514,7 +514,7 @@ Can be used on numbers and strings.
`max(a,b,c)`: Returns the maximum of `a`, `b` and `c`.
`max(sequence)`: Returns the maximum of all values in a sequence.

takes #comparisons ticks to execute.
takes `#comparisons` ticks to execute.

example:
`max([3,6,34,16])`
Expand All @@ -525,7 +525,7 @@ Can be used on numbers and strings.
`min(a,b,c)`: Returns the minimum of `a`, `b` and `c`.
`min(sequence)`: Returns the minimum of all values in a sequence.

takes #comparisons ticks to execute.
takes `#comparisons` ticks to execute.

example:
`min([3,6,34,16])`
Expand All @@ -534,7 +534,7 @@ Computes the absolute value of a number.

returns `number` if `number` is positive, `-number` otherwise.

takes 1 tick to execute.
takes `1` tick to execute.

example:
`abs(-69)`
Expand Down
8 changes: 8 additions & 0 deletions EN/Strings/hat_tooltips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@
@hat_descr_brown_hat = A brown hat.
@hat_descr_wizard_hat = The hat of a wizard. Unlocking this must have taken some programming magic!
@hat_descr_top_hat = It looks expensive and distinguished.
@hat_descr_the_farmers_remains = ?????
@hat_descr_traffic_cone = Safety first!
@hat_descr_traffic_cone_stack = Safety first! Safety first! Safety first! Safety first! Safety first! Safety first!
@hat_descr_pumpkin_hat = A pumpkin for your head. Perfect for Halloween.
@hat_descr_golden_pumpkin_hat = Can be obtained by participating in Spirit's Eve festival on Fall 27th.
@hat_descr_carrot_hat = Who wouldn't want carrots on their head?
@hat_descr_golden_carrot_hat = item.minecraft.golden_carrot
@hat_descr_cactus_hat = A bit spiky.
@hat_descr_golden_cactus_hat = Very spiky.
@hat_descr_sunflower_hat = Bright and cheerful.
@hat_descr_golden_sunflower_hat = Can be obtained by completing all Mini-Games, Puzzle Mode, and Survival Mode.
@hat_descr_gold_hat = Show off your wealth with this golden hat.
@hat_descr_golden_gold_hat = Okay at this point you are just making the leprechauns jealous.
@hat_descr_tree_hat = How nice!
@hat_descr_golden_tree_hat = Can be admired by visiting the east coast of San Andreas near Braddock Pass on Mount Gordo at night.
@hat_descr_gold_trophy_hat = Only for the best farmer.
@hat_descr_silver_trophy_hat = For the second best farmer.
@hat_descr_wood_trophy_hat = For the third best farmer.
2 changes: 1 addition & 1 deletion EN/Strings/unlock_tooltips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ for item in cost:
harvest()`
@unlock_descr_debug = Tools to help with debugging programs.

`print("hi")`
`print("Hello, World!")`
@unlock_descr_debug2 = Functions to temporarily slow down the execution and make the farm smaller.

`set_world_size(3)
Expand Down
1 change: 1 addition & 0 deletions EN/docs/scripting/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Comments can be added using `#`. Anything on the same line after the `#` is a co
This can be useful to add notes to the code, and also to temporarily disable parts of the code without deleting them.

Any comment on the line before a function definition will be part of the popup information that appears when you mouse over the function name.

`#This function does nothing.
def f():
pass`
2 changes: 1 addition & 1 deletion EN/docs/unlocks/dinosaurs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The hat can be equipped with

Unfortunately it doesn't quite look like on the advertisement...

If you equip the dinosaur hat and have enough pumpkins, an [apple](objects/apple) will automatically be purchased and placed under the drone.
If you equip the dinosaur hat and have enough cactus, an [apple](objects/apple) will automatically be purchased and placed under the drone.
When the drone is over an apple and moves again, it will eat the apple and grow its tail by one. If you can afford it, a new apple will be purchased and placed in a random location.
The apple cannot spawn if something else is planted where it wants to be.

Expand Down
4 changes: 2 additions & 2 deletions EN/docs/unlocks/leaderboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Success Condition: `num_items(Items.Cactus) >= 33554432`

### `Leaderboards.Sunflowers`
`leaderboard_run(Leaderboards.Sunflowers, filename, speedup)`
Success Condition: `num_items(Items.Sunflower) >= 100000`
Success Condition: `num_items(Items.Power) >= 100000`

### `Leaderboards.Pumpkins`
`leaderboard_run(Leaderboards.Pumpkins, filename, speedup)`
Expand Down Expand Up @@ -110,7 +110,7 @@ Success Condition: `num_items(Items.Cactus) >= 131072`

### `Leaderboards.Sunflowers_Single`
`leaderboard_run(Leaderboards.Sunflowers_Single, filename, speedup)`
Success Condition: `num_items(Items.Sunflower) >= 10000`
Success Condition: `num_items(Items.Power) >= 10000`

### `Leaderboards.Pumpkins_Single`
`leaderboard_run(Leaderboards.Pumpkins_Single, filename, speedup)`
Expand Down
21 changes: 14 additions & 7 deletions EN/docs/unlocks/mazes.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ It's only worth it if the extra information and the shortcuts help you solve the

The treasure can be relocated up to 300 times. After that, using weird substance on the treasure won't increase the gold in it anymore and it won't move anymore.

<spoiler=show hint 1>Here's a general approach to solving the problem:
<spoiler=show hint 1>
Here's a general approach to solving the problem:

Create a maze and imagine that you are the drone.

Expand All @@ -51,9 +52,12 @@ Write down your strategy step by step so that someone else could follow it witho

Now try translating your steps into code.
</spoiler>
<spoiler=show hint 2>As long as there are no loops: All the walls are really just one large connected wall. If you follow the wall, it will lead you through the whole maze.
This approach requires very little code and you do not need to keep track of where you have already been. Around 10 lines of code is all you need.</spoiler>
<spoiler=show hint 3>Instead of moving the drone in absolute directions like east or west it can be very useful to move the drone in relative directions like "turn right" or "turn left". To do this you need to keep track of which way the drone is currently moving. The drone never actually rotates, but you can still keep a "virtual" rotation in code.
<spoiler=show hint 2>
As long as there are no loops: All the walls are really just one large connected wall. If you follow the wall, it will lead you through the whole maze.
This approach requires very little code and you do not need to keep track of where you have already been. Around 10 lines of code is all you need.
</spoiler>
<spoiler=show hint 3>
Instead of moving the drone in absolute directions like east or west it can be very useful to move the drone in relative directions like "turn right" or "turn left". To do this you need to keep track of which way the drone is currently moving. The drone never actually rotates, but you can still keep a "virtual" rotation in code.
The following index trick is helpful for this:

`directions = [North, East, South, West]
Expand All @@ -66,6 +70,9 @@ index = (index + 1) % 4`
`# turn left
index = (index - 1) % 4

move(directions[index])`</spoiler>
<spoiler=show hint 4>If you can't solve it, you can always make your life easy and do it less efficiently.
Solvig a `1`x`1` maze is trivial.</spoiler>
move(directions[index])`
</spoiler>
<spoiler=show hint 4>
If you can't solve it, you can always make your life easy and do it less efficiently.
Solving a `1`x`1` maze is trivial.
</spoiler>
3 changes: 2 additions & 1 deletion EN/docs/unlocks/megafarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Here's another example that passes a different direction to each drone.
do_a_flip()
spawn_drone(task)`

<spoiler=show hint> Check out this super useful parallel `for_all` function, which takes any function and runs it on every farm tile. It makes use of all available drones to do so.
<spoiler=show hint>
Check out this super useful parallel `for_all` function, which takes any function and runs it on every farm tile. It makes use of all available drones to do so.

`def for_all(f):
def row():
Expand Down
2 changes: 1 addition & 1 deletion EN/docs/unlocks/pumpkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

When all the pumpkins in a square are fully grown, they will grow together to form a giant pumpkin. Unfortunately, pumpkins have a 20% chance of dying once they are fully grown, so you will need to replant the dead ones if you want them to merge.

When a pumpkin dies, it leaves behind a dead pumpkin that won't drop anything when harvested. Planting a new plant in its place automatically removes the dead pumpkin, so there is no need to harvest it. `can_harvest()` always returns `False` on dead pumpkins.
When a pumpkin dies, it leaves behind a dead pumpkin that won't drop anything when harvested. Planting a new plant in its place automatically removes the dead pumpkin, so there is no need to harvest it. Even though you can `harvest()` dead pumpkins, `can_harvest()` always returns `False` on dead pumpkins.

The yield of a giant pumpkin depends on the size of the pumpkin.

Expand Down
14 changes: 8 additions & 6 deletions EN/docs/unlocks/timing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ These two functions as well as `quick_print()`, are completely free. Even the ca
This is not how performance works in the real world. These are just rules made up for this game to have a consistent and understandable timing model.
You will probably only care about this if you want to hyper-optimize your code.


The basic unit of time for code execution is called a "tick". Without speed upgrades and power, the execution proceeds at a rate of `400` ticks per second.

In general, operations that combine two values such as `+, -, *, /, //, %, and, or, ...` take one tick to run.
Single value `-` and `not` are free.
An `if` branch also takes one tick to run (in addition to the time it takes to evaluate the condition expression).

`for` and `while` loops take one tick to start, but the iterations are free (not counting the time to evaluate the condition/sequence expressions).
`return`, `break` and `continue` are all free.
An `if` branch also takes one tick to run (not counting the time to evaluate the condition/sequence expressions).
Indexing into a datastructure takes one tick for the index operator and, in the case of a dictionary or set, additional ticks depending on the size of the key.

Function calls and variable reads and writes are free but function definitions take 1 tick.
If a function or module has been passed via arguments or variable assignments, using it will cost 1 tick instead of 0.
`import` statements are free.
Accessing an imported module with the `.` operator is free.
If a function or module has been passed via arguments or variable assignments, using it will cost 1 tick instead of 0.
`for` and `while` loops take one tick to start, but the iterations are free (not counting the time to evaluate the condition/sequence expressions).
`return`, `break` and `continue` are all free.

`pass` takes one tick so it can be used to create precise delays.
Indexing into a datastructure takes one tick for the index operator and, in the case of a dictionary or set, additional ticks depending on the size of the key.

The number of ticks that builtin functions take to execute is documented in the documentation of each function on an individual basis.
3 changes: 2 additions & 1 deletion EN/docs/unlocks/trees.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

Trees like to have some space and planting them right next to each other will slow down their growth. The growing time is doubled for each tree that is on a tile directly to the north, east, west or south of it. So if you plant trees on every tile, they will take `2*2*2*2 = 16` times longer to grow.

<spoiler=show> The `%` operator can be useful here. Remember that the `%` operator returns the remainder of the division. Even numbers divided by `2` have a remainder of `0` and odd numbers divided by `2` have a remainder of `1`.
<spoiler=show>
The `%` operator can be useful here. Remember that the `%` operator returns the remainder of the division. Even numbers divided by `2` have a remainder of `0` and odd numbers divided by `2` have a remainder of `1`.
So you can check if a number is even like this:

`def is_even(n):
Expand Down