Browse Source

Update README.md

pull/1/head
ykerus 4 years ago
parent
commit
ac8b09892e
  1. 55
      README.md

55
README.md

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
# 🟨🟦🟥 DropBlox 🟩🟧🟪
Welcome! I'm assuming you came here to give this coding challenge a try, great! After all, you could be the one to win the big price... So, let's get right to it!
Welcome! I'm assuming you came here to give this coding challenge a try, great! After all, you could be the one to take home the big price... So, let's get right to it!
## Quickstart 🎬
@ -10,7 +10,7 @@ You can either: @@ -10,7 +10,7 @@ You can either:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1NmfslkeZ4TWp-PZmq6XqWjoZhABoV82W?usp=sharing)
OR
OR
2. Clone this repo
@ -20,22 +20,59 @@ OR @@ -20,22 +20,59 @@ OR
and open `quick_start.ipynb`
## The rules 📜
> Check out the Quickstart example in the provided notebook on how to generate the solutions file.
### Points scheme
The task is simple: given a rectangular field and a set of predefined blocks, fill the field with the blocks and aim to get the highest score.
How do you score high? That depends on the colors of the blocks you used, the rows you filled and the amount of empty cells in the final field.
## Challenge and Rules 📜
### Submitting solutions
Don't worry, we took away most of the annoying work so you can focus on strategy. All you have to do is write a `.txt` file where each line specifies which block (by block ID) to drop in the field, and at which x-coordinate.
The task is simple: given a rectangular field and a set of predefined blocks, fill the field with the blocks in a way to maximize your score.
> Check out the Quickstart example on how to generate the solutions file.
How do you score high? That depends on the colors of the blocks you used, the rows you filled and the amount of empty tiles in the final field.
### > Field
You are given a `Field` object `field` with `field.height = field.width = 100`. Initially it is empty, but you can drop blocks in the field which will change the array `field.values`. To make it visual, simply print your field and view the result in a text editor.
### > Blocks
Blocks have a shape, a color and a unique ID. They are defined as instances of the class `Block`. The list of available blocks is defined as `blocks` in the provided notebook. Similar as with the field, we can visualize the blocks. The first block, `B = blocks[0]` with `B.block_id = 0`, looks like this:
```
🟧🟧🟧
🟧⬜🟧
🟧
```
This is an orange block, so `B.color = "O"`, and `B.width = B.height = 3`. Blocks are dropped in the field *as is*, so they cannot be rotated. Also, a block can only be dropped once, but you don't have to use all of the provided blocks. Okay, now we can drop this block in our field, but how do we decide where to drop it?
### > Rewards
Each color has a number of *points* and a *multiplication factor*. These will determine your score, once you dropped some of blocks in the field. The values for each color are defined under `rewards`. For example, for orange, we have `rewards.points["O"] = 5` and `rewards.multiplication_factors["O"] =
3`.
This means: for every orange tile in our final field, we get +5 points. So just by dropping the orange block from above we would already get +30 points.
With the multiplication factor, things can get crazy: if the *<ins>entire row</ins>* is filled with tiles of the *<ins> same color</ins>*, you get the values of those tiles multiplied by the corresponding factor.
Lastly, you can get minus points. If a row contains at least one colored tile, all empty tiles in that row count as -1 towards your final score.
That should help you decide which blocks to drop, and where!
## Your Solution 💻
Your solution should be a `.txt` file where each line specifies which block (by block ID) to drop in the field, and at which x-coordinate. To clarify, the *bottom left* of the block will be dropped at the provided x-coordinate in the field.
For exmple, you could write `solution.txt` with:
```
322 54
12 4
...
```
which tells us to first drop the block with `block_id = 322` at x-coordinate `54`, and then drop the block with `block_id = 12` at x-coordinate `4`, etc.
Submit your solution `.txt` at: https://dropblox.azurewebsites.net/submit
## Leaderboard 🏆
Want to see how you compare to the rest? <br>
Go to: https://dropblox.azurewebsites.net/leaderboard

Loading…
Cancel
Save