Skip to content

Instantly share code, notes, and snippets.

View shiracamus's full-sized avatar

@shiracamus shiracamus

View GitHub Profile
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)
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <time.h>
typedef enum {
WALL = 'X',
DEAD = ' ',
ALIVE = 'O',
#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;
import random
import time
DEPOP = 1 # 過疎条件
OVERCROW = 4 # 過密条件
ALIVE_LOWER = 3 # 発生条件(下限)
ALIVE_UPPER = 3 # 発生条件(上限)
ETERNAL = False # セルの永続化フラグ
INITIALIZE_ALIVE_RATE = 20 # 初期セルの生存率(%)
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'
import time
from multiprocessing import Process, Pipe
from tkinter import Tk, ttk, StringVar
def execute():
"""
コマンド実行
"""
print('コマンドボタン 押下')
# 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),
@shiracamus
shiracamus / docker-compose.nextcamp.yml
Last active October 18, 2020 08:36
WebGME MIC docker-compose YAML for Security Next Camp 2020 in Japan
# 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
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;
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.*;