sleibrock / beachalyzer

Analyze a Beach with some S-expr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Beachalyzer

Analyze your Boom Beach costs and figure out what's the next logical, and most cheapest upgrade.

Calculates the cost differential between upgrading a building and upgrading a headquarters as well.

What's the "Cost" of a building?

Cost is the total aggregate cost of a building upgrade. Here we add all resources (wood, stone and iron) into one number - this is what we will call the 'total cost' of the building.

cost = wood + stone + iron

The aim is to figure out the lowest costing building, so we will use a functional model to find the lowest cost building.

findLowest :: List -> List -> Pair -> Pair
findLowest a b c
    | a = [] == c
    | otherwise == findLowest (tail a) b 
                        (if (cost (head a) b) < (cost c b)
                          then (head a) else c)

Usage

First compile the package using the makefile

$ make

Binaries are placed in the bin/ folder once compiled.

Then, use FileGenerator to create a template file for you to use.

$ ./bin/FileGenerator my_base.txt

This will generate a template file containing building names and their levels. Edit the zeroes so the numbers match the level of your lowest building.

Once that's done, you can parse the file with the Beachalyzer binary

$ ./bin/Beachalyzer my_base.txt

Some information will come out and it will give you some helpful information.

Example Output

Output will typically look like this (included in this project is a test file you can try it out on).

beaches are expensive

Defense Strategies

If you need advice on defensive upgrades, check out the Strategies.md file.

About

Analyze a Beach with some S-expr


Languages

Language:Racket 99.6%Language:Makefile 0.4%