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
# for alpine 3.8 | |
apk add --no-cache gogs bash | |
cd /usr/bin | |
ln -s /usr/share/webapps/gogs/templates templates | |
ln -s /usr/share/webapps/gogs/public public | |
mkdir custom | |
mkdir custom/conf | |
chmod -R 777 custom templates public | |
adduser -D git | |
cat > /etc/Procfile <<EOF |
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
import numpy as np | |
import string | |
import re | |
class ShipGame: | |
def __init__(self, width, height): | |
self.width = width | |
self.height = height |
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
# ship battle game | |
# 1. ships can generate a detect value to every block nearby, v = 1 / (dx * dx + dy * dy) | |
# 2. the sea has its own detect limit, which will decrease slightly | |
# 3. attack will add a temp detect value to 3x3 blocks | |
# 4. any block where detect value * 2 + temp value > sum(detect value) + detect limit will be visible | |
import numpy as np | |
import re | |
import string | |
import sys |
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
module HappyMath | |
class FullPermutationRepeat | |
include Enumerable | |
def initialize(args, n) | |
@args = args | |
@n = n | |
end | |
def each(&b) |