This repository has been archived by the owner on Oct 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.vscode | ||
4-crazy-eights/gameBuilder.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.PHONY: all | ||
all: go js php py | ||
|
||
.PHONY: go | ||
go: | ||
@echo "go" | ||
docker run --rm -it `docker build -q -f go.Dockerfile .` | ||
|
||
.PHONY: js | ||
js: | ||
@echo "js" | ||
docker run --rm -it `docker build -q -f js.Dockerfile .` | ||
|
||
.PHONY: php | ||
php: | ||
@echo "php" | ||
docker run --rm -it `docker build -q -f php.Dockerfile .` | ||
|
||
.PHONY: py | ||
py: | ||
@echo "py" | ||
docker run --rm -it `docker build -q -f py.Dockerfile .` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Day 4 - Crazy Eights | ||
|
||
Crazy Eights is a very popular game at the North Pole, but there are no playing | ||
cards and the rules are completely different... | ||
|
||
**Running `./newGame` in this directory outputs a new game of Crazy Eights.** | ||
|
||
One elf will write a [7x7] matrix of digits between 0 and 9. Each digit in the | ||
matrix has an equal chance of being any of the ten possible digits. Once the | ||
matrix is complete, competing elves must find the sum of the count of 8s for | ||
each row and each column then add the values of the two new [1x7] matrices. | ||
|
||
Write a function that can solve a game of Elven Crazy Eights. | ||
|
||
Example: | ||
``` | ||
[2 4 8 2 0 4 1] -> 1 | ||
[5 1 2 7 6 2 1] -> 0 | ||
[0 0 0 3 2 4 4] -> 0 | ||
[3 1 5 3 5 2 2] -> 0 | ||
[8 2 4 6 3 1 4] -> 1 | ||
[1 0 8 8 5 4 8] -> 3 | ||
[0 4 2 2 6 1 6] -> 0 | ||
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ | ||
[1 0 2 1 0 0 1] | | ||
[1 0 0 0 1 3 0] <- ⌟ | ||
+ | ||
⇓ | ||
[2 0 2 1 1 3 1] Solution | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM golang:1-alpine | ||
COPY crazy-eights.go . | ||
CMD [ "go", "run", "crazy-eights.go" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM node:lts-alpine | ||
COPY crazy-eights.js . | ||
CMD [ "node", "crazy-eights.js" ] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM php:7-cli-alpine | ||
COPY crazy-eights.php . | ||
CMD [ "php", "crazy-eights.php" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM python:3-alpine | ||
COPY crazy-eights.py . | ||
CMD [ "python", "crazy-eights.py" ] |