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 numpy as np | |
_ = 0 | |
problem = [ | |
[_, _, _, _, 4, _, _, _, _], | |
[_, _, 5, _, _, _, _, _, _], | |
[_, 3, 6, 8, _, _, _, 7, 2], | |
[_, 8, _, _, _, 6, 5, _, _], | |
[1, _, _, 5, _, _, _, 9, _], |
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
board = """ | |
| 45| 6| 3 | | |
| | 49|126| | |
| | | | | |
+---+---+---+ | |
| 12| | 4| | |
|9 | 62| | | |
| 87| | 9| | |
+---+---+---+ | |
| | | | |
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
class Stone: | |
SPACE = "." | |
BLACK = "X" | |
WHITE = "O" | |
class Board: | |
def __init__(self, size): | |
self.cells = [[Stone.SPACE] * size for i in range(size)] |
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 | |
from time import sleep | |
import tkinter as tk | |
from tkinter import messagebox | |
TITLE = "Othello" | |
class Stone: | |
NONE = "." |
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 argparse | |
try: | |
from Crypto.Random import random | |
except ImportError: | |
try: | |
import secrets as random | |
except ImportError: | |
import random | |
""" |
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
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 } | |
}, |
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.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; } |
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
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以上の奇数で作成してください。"); |
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 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), |
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.*; |