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 Blackjack | |
def play | |
puts <<~END | |
======================= | |
Welcome to Blackjack!!! | |
======================= | |
END |
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 | |
class Hand: | |
def __init__(self, shape, stronger_than): | |
self.shape = shape | |
self._stronger_than = stronger_than | |
def __repr__(self): |
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
//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; |
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
/* Model */ | |
enum Face { NONE, BLACK, WHITE, INVALID }; | |
class Piece { | |
final Face face, reverse; | |
Piece(Face face, Face reverse) { | |
this.face = face; | |
this.reverse = reverse; |
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
#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[] = {" ", "○", "●", "??"}; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <iostream> | |
// 構造体はデータ定義。処理関数は別定義。他と同じ関数名にならないよう気を使う | |
typedef struct { | |
const char *name; | |
} StructDrink; | |
void ask_more(StructDrink *drink) { |
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 Stone { | |
NONE("."), | |
BLACK("X"), | |
WHITE("O"), | |
INVALID("?"); | |
private final String text; | |
private Stone(String text) { | |
this.text = text; |
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 | |
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) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <unistd.h> | |
#include <time.h> | |
typedef enum { | |
WALL = 'X', | |
DEAD = ' ', | |
ALIVE = 'O', |
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
#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; |