This file contains hidden or 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 random | |
import pygame | |
from enum import Enum | |
# COLOR | |
BLACK = (0, 0, 0) | |
WHITE = (255, 255, 255) | |
FLORALWHITE = (255, 250, 240) | |
LIGHTGRAY = (211, 211, 211) | |
GRAY = (128, 128, 128) |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <unistd.h> | |
#include <time.h> | |
typedef enum { | |
WALL = 'X', | |
DEAD = ' ', | |
ALIVE = 'O', |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <time.h> | |
typedef const char *String; | |
typedef int Count; | |
typedef int Pos; | |
typedef int Delta; |
This file contains hidden or 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 random | |
import time | |
DEPOP = 1 # 過疎条件 | |
OVERCROW = 4 # 過密条件 | |
ALIVE_LOWER = 3 # 発生条件(下限) | |
ALIVE_UPPER = 3 # 発生条件(上限) | |
ETERNAL = False # セルの永続化フラグ | |
INITIALIZE_ALIVE_RATE = 20 # 初期セルの生存率(%) |
This file contains hidden or 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 time | |
def sec_to_time(sec): | |
"""引数secの秒数を'HH:MM:SS'形式文字列に変換して返す""" | |
m, s = divmod(int(sec), 60) | |
h, m = divmod(m, 60) | |
return f'{h:02}h {m:02}m {s:02}s' | |
This file contains hidden or 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 time | |
from multiprocessing import Process, Pipe | |
from tkinter import Tk, ttk, StringVar | |
def execute(): | |
""" | |
コマンド実行 | |
""" | |
print('コマンドボタン 押下') |
This file contains hidden or 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
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1181&lang=ja | |
from collections import defaultdict | |
class Die: | |
TOP, FRONT, RIGHT, BACK, LEFT, BOTTOM = 0, 1, 2, 3, 4, 5 | |
ROLL = { | |
TOP: (FRONT, RIGHT, BACK, LEFT), | |
FRONT: (TOP, FRONT, BOTTOM, BACK), | |
RIGHT: (TOP, RIGHT, BOTTOM, LEFT), |
This file contains hidden or 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
# To build and launch (first time): | |
# $ docker-compose up -d | |
# To create new images (--no-cache) to force building from scratch: | |
# $ docker-compose build | |
# To launch again (leave out -d for non daemon launch): | |
# $ docker-compose up -d | |
# Short command for rebuilding and restarting | |
# $ docker-compose up -d --build | |
# To stop containers: | |
# $ docker-compose stop |
This file contains hidden or 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 java.util.List; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Random; | |
import java.util.function.Consumer; | |
import java.awt.Component; | |
import java.awt.CardLayout; | |
import java.awt.Graphics; | |
import java.awt.Font; | |
import java.awt.Color; |
This file contains hidden or 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 java.util.List; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Random; | |
import java.awt.*; | |
import java.awt.event.*; | |
import java.awt.Color; | |
import java.awt.Rectangle; | |
import javax.swing.*; |