Skip to content

Instantly share code, notes, and snippets.

View shiracamus's full-sized avatar

@shiracamus shiracamus

View GitHub Profile
import numpy as np
_ = 0
problem = [
[_, _, _, _, 4, _, _, _, _],
[_, _, 5, _, _, _, _, _, _],
[_, 3, 6, 8, _, _, _, 7, 2],
[_, 8, _, _, _, 6, 5, _, _],
[1, _, _, 5, _, _, _, 9, _],
board = """
| 45| 6| 3 |
| | 49|126|
| | | |
+---+---+---+
| 12| | 4|
|9 | 62| |
| 87| | 9|
+---+---+---+
| | | |
@shiracamus
shiracamus / othello_cui.py
Last active April 15, 2023 00:49
CUI Othello
class Stone:
SPACE = "."
BLACK = "X"
WHITE = "O"
class Board:
def __init__(self, size):
self.cells = [[Stone.SPACE] * size for i in range(size)]
import random
from time import sleep
import tkinter as tk
from tkinter import messagebox
TITLE = "Othello"
class Stone:
NONE = "."
import argparse
try:
from Crypto.Random import random
except ImportError:
try:
import secrets as random
except ImportError:
import random
"""
function iter(pattern) {
let index = 0
return {
[Symbol.iterator]: function() { return this },
next: function() {
if (index < pattern.length)
return { value: pattern[index++], done: false }
else
return { done: true }
},
import java.awt.*;
import javax.swing.*;
class Life {
private static final String DEAD = "0";
private static final String ALIVE = "1";
private String state = DEAD;
public void dead() { state = DEAD; }
public void alive() { state = ALIVE; }
enum Cell { WALL, ROAD };
class Map {
public final int width;
public final int height;
private final Cell[][] cells;
public Map(int width, int height) {
if (width < 5 || height < 5 || width % 2 == 0 || height % 2 == 0) {
new IllegalArgumentException("縦・横共に5以上の奇数で作成してください。");
import sys
import csv
from time import sleep
import requests
from bs4 import BeautifulSoup
def main():
genre = 'tonkatsu' if len(sys.argv) < 2 else sys.argv[1]
save_csv(f'{genre}.csv', shops(genre),
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.*;