1. The Farmer Was Replaced
  2. News

The Farmer Was Replaced News

Imports And Global Variables

Breaking Changes:
You'll have to change these in your code.

Functions defined in other files (windows in the game) are no longer imported implicitly. You now have to unlock and use explicit import statements like in Python (See the import unlock).

Breaking Changes from older Patches that you might have missed:
-`Items.Bones` has been renamed to `Items.Bone` so all items are singular.
-`Entities.Carrots` has been renamed to `Entities.Carrot` so all entities are singular.
-`Grounds.Turf` has been renamed to `Grounds.Grassland` to make it easier to understand.
-`Items.Water_Tank` has been renamed to `Items.Water` because the tank refill feature has been removed.
-`Unlocks.Benchmark` has been replaced with `Unlocks.Timing`.
-`get_op_count()` has been renamed to `get_tick_count()`.
-`set_farm_size()` has been renamed to `set_world_size()` to be consistent with `get_world_size()`.
-`get_companion()` now returns a tuple of the form (entity, (x, y)) instead of a list.
-`trade()` has been removed from the game.

Global Variabels:
-Scopes and global variable have been changed to work like in Python. This means you can now use the `global` keyword to write to the global scope.
-There is now an error for using a local variable before it was assigned locally even if there is a global variable with the same name.
-The shadowing error messages have been removed.

Imports:
The old import system automatically imported all functions from all files. This had the big disadvantage that global variables from other files could not be imported and were therefore inaccessible.
The new import system is a slightly simplified version of how imports work in Python. You can import a module using the `import file` or `from file import *` syntax.

Other Changes:
-Added `str()` function.
-Added destructuring support in for loops.
-Various docs changes.
-Fixed passing functions into simulations.
-Fixed using `in` and `not in` with functions.
-Fixed set function allowing lists as keys.

Documentation fix

-Added more crosslinks between docs pages.
-Fixed the messed up expand page.

Fixes

-Fixed Expand_2 page missing in the table of contents and added a link from Expand_1.
-Polyculture now actually starts at 5x like documented.
-Fixed the displayed plant cost in entity tooltips.
-Using a negative number of items now throws an error instead of giving you items.
-Division by 0 now throws an error instead of returning NaN.
-Fixed the invalid key error message of `set.add()`.
-Indexing dicts with empty tuples is no longer free.
-Fixed leaderboard UI blocking mouse clicks.
-Resolved the issues that sometimes caused an older version of the code to execute.
-Fixed a bug preventing the drone to move onto the end of the dinosaur tail one move after picking up an apple.
-Fixed a bug that caused window sizes to stop snapping to the code after moving the window.

Nerfed Dynamic Function Calls

Some players have found some fun exploits that use dynamic function calls to do free computations. Unfortunately these strategies aren't in the spirit of the leaderboard and have to be nerfed.

-Calling a function that has been reassigned to a new variable or argument now takes 1 tick instead of 0 ticks.

Hotfix

-Fixed planting cost not scaling with upgrades.
-Reset `Leaderboards.Fastest_Reset`, `Leaderboards.Polyculture` and 60s stats.
-Removed the simulation speedup cap.