Skip to content

Commit

Permalink
Merge pull request #5 from hgwr/develop
Browse files Browse the repository at this point in the history
release 0.0.1
  • Loading branch information
hgwr authored Jun 17, 2023
2 parents 0306594 + 3a4b05f commit f41f3d3
Show file tree
Hide file tree
Showing 67 changed files with 3,960 additions and 525 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ out/
.vscode/

src/main/resources/static

.DS_Store
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
50 changes: 50 additions & 0 deletions README-ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# oi - a card game

## Build and run

```shell
cd front
npm i
cd ..
./gradlew buildFront clean bootJar
java -jar build/libs/oi-0.0.1-SNAPSHOT.jar
```

Access to http://localhost:8080/

## How to play oi

demo: https://oi.moreslowly.jp/

## 遊び方

### ゲームの目的

Oi はおいちょかぶに似たカードゲームです。それはトランプを使用したシンプルなカードゲームです。プレイヤーは手札のカードの合計値の一桁目で競います。最も強い手札を持つプレイヤーが勝者となり、賭けた金額を獲得します。

### 準備

- 1 〜 6 人のプレイヤー

### ゲームの進行

1. **手札の配布**: ゲームが開始されると、各プレイヤーに2枚のカードが配られます。1枚は裏向き(見えない)、もう1枚は表向き(見える)となります。

2. **賭け金の設定**: プレイヤーは手札の強さに自信があると感じた場合、任意の賭け金を設定します。

3. **カードの公開**: 賭け金を設定したプレイヤーは、裏向きになっていたカードをめくり、手札の2枚を確認します。

4. **手札の強さの計算**: 手札の2枚のカードを足し合わせます。このとき、Jは11、Qは12、Kは13として計算し、数字のカードはそのままの数値で計算します。スートは関係ありません。手札の強さは、カードの合計値の一桁目によって決まります。9が最も強く、8, 7, 6, 5, 4, 3, 2, 1, 0 の順に弱くなります。

5. **追加カードの要求**: プレイヤーは、手札の強さに満足がいかない場合、もう1枚のカードを要求することができます。この場合、3枚のカードの合計値の一桁目で手札の強さを計算します。

6. **コンピュータプレイヤーの手札**: プレイヤーが手札の強さを決定した後、コンピュータプレイヤーが親として自分の手札を構成し、強さを決定します。

7. **勝敗の判定**: プレイヤーの手札の強さとコンピュータプレイヤーの手札の強さを比較します。プレイヤーの方が強ければ、賭けた金額

がプレイヤーに支払われます。

### 注意点

- 合計値の一桁目が同じ場合、引き分けとなります。
- プレイヤーは追加カードを要求するかどうか慎重に考えましょう。3枚目のカードによって、手札の強さが変わります。
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# oi - a card game

## Build and run

```shell
cd front
npm i
cd ..
./gradlew buildFront clean bootJar
java -jar build/libs/oi-0.0.1-SNAPSHOT.jar
```

Access to http://localhost:8080/

## How to play oi

demo: https://oi.moreslowly.jp/

### Objective of the Game

Oi is a Oicho-Kabu like card game. It is a simple card game that uses a standard deck of playing cards. Players compete by calculating the units digit of the sum of their cards. The player with the strongest hand wins the bet.

### Preparation

- 1 to 6 players

### Game Progression

1. **Dealing the Cards**: At the start of the game, each player is dealt two cards. One card is face down (hidden), and the other is face up (visible).

2. **Setting the Bet**: Players place bets if they feel confident about the strength of their hand.

3. **Revealing the Card**: Players who have placed bets will turn over their face-down card, allowing them to see both of their cards.

4. **Calculating Hand Strength**: Add the values of the two cards in your hand. For this calculation, J is 11, Q is 12, and K is 13, while numerical cards hold their face value. Suits do not matter. The strength of a hand is determined by the units digit of the sum of the cards. 9 is the strongest, followed by 8, 7, 6, 5, 4, 3, 2, 1, and 0.

5. **Requesting an Additional Card**: If a player is not satisfied with the strength of their hand, they may request one additional card. In this case, the hand strength is calculated using the units digit of the sum of the three cards.

6. **Computer Player’s Hand**: After the player has determined the strength of their hand, the computer player, acting as the dealer, constructs its hand and determines its strength.

7. **Determining the Winner**: Compare the strength of the player’s hand with the strength of the computer player’s hand. If the player’s hand is stronger, they are paid the amount of the bet.

### Points to Note

- If the units digit of the sum is the same for both players, it is considered a draw.
- Players should carefully consider whether or not to request an additional card. The third card can alter the strength of their hand.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ repositories {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-quartz'
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand All @@ -28,6 +29,8 @@ dependencies {
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

implementation group: 'ch.qos.logback', name: 'logback-access', version: '1.4.6'
}

tasks.named('test') {
Expand Down
14 changes: 14 additions & 0 deletions docs/name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# names

サクラ
ウメ
カエデ
シラカバ
アジサイ
ツツジ
モミジ
ツバキ
マツ
モクレン
タケ
ヒイラギ
21 changes: 21 additions & 0 deletions docs/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# spec

入口 `https://oi.moreslowly.jp/`

名前を入力
セッションに保存
名前の表示
名前の変更

`/?room=UUID`

- 開始 start
- シャッフル shuffle
- カードを配る hand out cards
- 掛け金設定 wait to bet
- 全員OK
- 3枚目のカードの要否 wait to request additional card
- 全員OK
- 親が自分のカードをめくる parent turns over cards
- 親が三枚目のカードを取るか決める parent hand is determined
- 清算 liquidation
4 changes: 2 additions & 2 deletions front/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/1F3B4.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
<title>Oi</title>
</head>
<body>
<div id="app"></div>
Expand Down
Loading

0 comments on commit f41f3d3

Please sign in to comment.