Skip to content

Instantly share code, notes, and snippets.

View shiracamus's full-sized avatar

@shiracamus shiracamus

View GitHub Profile
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;
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;