This is the code of AltugCar, which has finished in 10th place on 0xMonaco by Paradigm CTF.
AltugCar aims to save money until the last bit of the race while disrupting its enemies' economy.
The algorithm is as follows:
-
If AltugCar is in the first place, it buys acceleration until the cost of a shell. If the second player does not have enough coins, it inflates the price of a shell.
-
If AltugCar is in the second place, it tries to catch up with the first player by buying a shell, or buying enough acceleration, whichever is cheaper.
-
If AltugCar is in the last place, it buys all the acceleration allowed to try catching up.
- Clone or Fork this repository
git clone https://github.com/altugbakan/altug-car
cd huff-heap-sort
- Install dependencies
forge install
- Build and race the car against the other cars (default: AltugCar vs ExampleCar vs ExampleCar)
forge build
forge test