protostar installpython -m venv envsource env/bin/activatepip install -r requirements.txtnile install
This repo has 2 difficulty levels: beginner, advanced, and then a final exercise.
contracts<beginner/advanced>/ex contrains exercises with instructions on what to do.
Run pytest tests/test_<beginner/advanced>_ex00.py --runworkshop and code until the tests pass.
Repeat for all contracts. Have fun !
First, start a local node:
nile nodeThen, deploy the contracts:
nile run scripts/deploy.pyKeep the addresses of the contracts, you'll need them later.
Implement your ship to catch as much dust as possible.
To add your ship, compile it and deploy it
nile compile
nile deploy <my-ship-contract>Then, add the ship to the game's space
nile invoke <space-contract-address> add_ship <x> <y> <ship-contract-address>Finally, call next_turn to let the game computes the next turn
nile invoke <space-contract-address> next_turnmake test
Coding your ship logic can be tricky, we suggest you use tests to check your code.
You can get inspiration from the static ship tests and run this specific test with pytest tests -k "test_next_turn_with_ship".
make cli