Skip to content

Instantly share code, notes, and snippets.

View shiracamus's full-sized avatar

@shiracamus shiracamus

View GitHub Profile
import random
class Character:
def __init__(self, name, hit_point, attack_power):
self.name = name
self.hit_point = hit_point
self.attack_power = range(attack_power + 1)
def is_dead(self):
import wordlist
from typing import Callable
def best_candidate(words: list[str]) -> str:
if len(words) > 3**5:
return None
for candidate in words:
patterns = set("".join("g" if c == w else "y" if c in word else "w"
for c, w in zip(candidate, word))
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
import java.util.stream.Collectors;
import java.util.Scanner;
public class BlackJack {
public static void main(String[] args) {
System.out.println("ブラックジャックゲーム");
Deck deck = new Deck();
class Blackjack
def play
puts <<~END
=======================
Welcome to Blackjack!!!
=======================
END
import random
class Hand:
def __init__(self, shape, stronger_than):
self.shape = shape
self._stronger_than = stronger_than
def __repr__(self):
//package myProgram;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.DecimalFormat;
/* Model */
enum Face { NONE, BLACK, WHITE, INVALID };
class Piece {
final Face face, reverse;
Piece(Face face, Face reverse) {
this.face = face;
this.reverse = reverse;
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
typedef enum { NONE, BLACK, WHITE, INVALID } stone_t;
const char *STONE[] = {" ", "○", "●", "??"};
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
// 構造体はデータ定義。処理関数は別定義。他と同じ関数名にならないよう気を使う
typedef struct {
const char *name;
} StructDrink;
void ask_more(StructDrink *drink) {
enum Stone {
NONE("."),
BLACK("X"),
WHITE("O"),
INVALID("?");
private final String text;
private Stone(String text) {
this.text = text;