Skip to content

Commit

Permalink
modify string "tetris_game" --> "tetris"
Browse files Browse the repository at this point in the history
  • Loading branch information
seigot committed Dec 17, 2021
1 parent 4445266 commit 98fd882
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 55 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Tetris Game

プログラミング学習を目的とした、ブロックを操作してスコアを競うゲームです。<br>
[FAQ](https://github.com/seigot/tetris_game/blob/master/doc/files/FAQ.md)はこちら。<br>
[tutorial](https://github.com/seigot/tetris_game_tutorial)はこちら。
[FAQ](https://github.com/seigot/tetris/blob/master/doc/files/FAQ.md)はこちら。<br>
[tutorial](https://github.com/seigot/tetris_tutorial)はこちら。

## 実行環境準備

Expand Down Expand Up @@ -40,13 +40,13 @@ brew install git

```shell
cd $HOME
git clone https://github.com/seigot/tetris_game
git clone https://github.com/seigot/tetris
```

ゲーム開始用スクリプトを実行

```shell
cd tetris_game
cd tetris
bash start.sh
```

Expand Down Expand Up @@ -91,7 +91,7 @@ bash start.sh
## スコアアタック用サンプルコード

実行時、以下のようにオプションを与えることで、スコアアタック用サンプルコードの実行が可能です。<br>
サンプルコードについて[ブロック操作用サンプルプログラム](https://github.com/seigot/tetris_game/blob/master/doc/files/block_controller_sample.md)を参照下さい。<br>
サンプルコードについて[ブロック操作用サンプルプログラム](https://github.com/seigot/tetris/blob/master/doc/files/block_controller_sample.md)を参照下さい。<br>

```shell
bash start.sh -s y
Expand Down Expand Up @@ -143,30 +143,30 @@ bash start.sh -s y
> リポジトリのフォークの例 <br>
>
> 0. GitHubアカウントを作成/ログインする。 <br>
> 1. GitHub で、[https://github.com/seigot/tetris_game](https://github.com/seigot/tetris_game)リポジトリに移動します <br>
> 1. GitHub で、[https://github.com/seigot/tetris](https://github.com/seigot/tetris)リポジトリに移動します <br>
> 2. ページの右上にある [Fork] をクリックします。 <br>
> 参考:[リポジトリをフォークする](https://docs.github.com/ja/free-pro-team@latest/github/getting-started-with-github/fork-a-repo) <br>
その後、自リポジトリにforkした`tetris_game`をローカルマシンに取得して下さい。
その後、自リポジトリにforkした`tetris`をローカルマシンに取得して下さい。

```
cd ~
git clone https://github.com/<yourname>/tetris_game # "<yourname>"さん(yourname=自分のアカウント名に読みかえて下さい)のリポジトリを取得する場合
git clone https://github.com/seigot/tetris_game # このリポジトリを取得する場合
git clone https://github.com/<yourname>/tetris # "<yourname>"さん(yourname=自分のアカウント名に読みかえて下さい)のリポジトリを取得する場合
git clone https://github.com/seigot/tetris # このリポジトリを取得する場合
```

既に`tetris_game`が存在しており、これを削除したい場合は`rm -f`を実行して下さい。
既に`tetris`が存在しており、これを削除したい場合は`rm -f`を実行して下さい。

```
sudo rm -rf tetris_game
sudo rm -rf tetris
```

取得後はソースコード変更、変更リポジトリに反映する等してアップデートを進めて下さい。

### 実行

`実行方法`を参考に実行環境の構築をして下さい。<br>
環境構築の完了後、ブロック操作用プログラム[`block_controller.py`](https://github.com/seigot/tetris_game/blob/master/block_controller.py)を更新していってください。<br>
環境構築の完了後、ブロック操作用プログラム[`block_controller.py`](https://github.com/seigot/tetris/blob/master/block_controller.py)を更新していってください。<br>

### 自リポジトリのバイナリを公式リリースする

Expand All @@ -186,7 +186,7 @@ sudo rm -rf tetris_game

```
git checkout master # ローカルのmainブランチに移動
git remote add upstream https://github.com/seigot/tetris_game # fork元のリポジトリをupstream という名前でリモートリポジトリに登録(名前はなんでもいい。登録済みならスキップ)
git remote add upstream https://github.com/seigot/tetris # fork元のリポジトリをupstream という名前でリモートリポジトリに登録(名前はなんでもいい。登録済みならスキップ)
git fetch upstream # upstream から最新のコードをfetch
git merge upstream/master # upstream/main を ローカルのmaster にmerge
git push # 変更を反映
Expand All @@ -212,8 +212,8 @@ git push # 変更を反映

# 参考

[https://github.com/LoveDaisy/tetris_game](https://github.com/LoveDaisy/tetris_game) <br>
[https://github.com/seigot/tetris_game(2021.12時点まで使用)](https://github.com/seigot/tetris_game)
[https://github.com/LoveDaisy/tetris](https://github.com/LoveDaisy/tetris) <br>
[https://github.com/seigot/tetris(2021.12時点まで使用)](https://github.com/seigot/tetris)
[http://zetcode.com/gui/pyqt5/tetris/](http://zetcode.com/gui/pyqt5/tetris/)<br>
[テトリスの歴史を「ブロックが落ちるルール」の進化から学ぶ](https://gigazine.net/news/20191116-tetris-algorithm/)<br>

Expand Down
22 changes: 11 additions & 11 deletions doc/files/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# FAQ

## level1ではブロックの順番は固定とのことだが、具体的にはどんな順番になっているのか
`level1(ブロックの順番固定)`の場合は、[ブロックのindex値](https://github.com/seigot/tetris_game/blob/master/doc/files/block_controller.md#ブロック情報)`1→2→3→4→5→6→7→1→...`の順番に出現します。
`level1(ブロックの順番固定)`の場合は、[ブロックのindex値](https://github.com/seigot/tetris/blob/master/doc/files/block_controller.md#ブロック情報)`1→2→3→4→5→6→7→1→...`の順番に出現します。

## python実行環境について

| 環境 | 環境構築手順 |
| ---- | ---- |
| ubuntu18.04,20.04 | [こちら](https://github.com/seigot/tetris_game/blob/master/doc/files/install_ubuntu.md) |
| Mac | [こちら](https://github.com/seigot/tetris_game/blob/master/doc/files/install_mac.md) |
| Windows+Docker | [こちら](https://github.com/seigot/tetris_game/blob/master/docker/README.md) |
| ubuntu18.04,20.04 | [こちら](https://github.com/seigot/tetris/blob/master/doc/files/install_ubuntu.md) |
| Mac | [こちら](https://github.com/seigot/tetris/blob/master/doc/files/install_mac.md) |
| Windows+Docker | [こちら](https://github.com/seigot/tetris/blob/master/docker/README.md) |
| JetsonNano | (動作未確認だがおそらく動くはず) |
| RaspberryPi | (動作未確認だがおそらく動くはず) |
| Windows+GoogleChrome+ubuntu-free-online-linux | [chrome webstore URL](https://chrome.google.com/webstore/detail/ubuntu-free-online-linux/pmaonbjcobmgkemldgcedmpbmmncpbgi?hl=ja) |
Expand All @@ -25,7 +25,7 @@
 ・terminal上で以下コマンドを実行<br>
```
sudo apt install −y git
git clone http://github.com/seigot/tetris_game
git clone http://github.com/seigot/tetris
cd tetris game
bash doc/files/install_ubuntu.sh
```
Expand All @@ -50,7 +50,7 @@ $ sudo rm /var/lib/dpkg/lock-frontend
```

## サンプルプログラム(`bash start.sh -s y`で動くやつ)の中身はどうなってるのか
[こちら](https://github.com/seigot/tetris_game/blob/master/doc/files/block_controller_sample.md)で解説
[こちら](https://github.com/seigot/tetris/blob/master/doc/files/block_controller_sample.md)で解説

## スコアアタック時の動作PC環境について

Expand All @@ -73,7 +73,7 @@ $ python3 -c 'import torch; print(torch.__version__) '
```

ソフト環境は以下スクリプトで構築しています。(散らかっててすみません)<br>
[auto_setup_for_Linux.sh](https://github.com/seigot/tetris_game/blob/master/docker/auto_setup_for_Linux.sh)<br>
[auto_setup_for_Linux.sh](https://github.com/seigot/tetris/blob/master/docker/auto_setup_for_Linux.sh)<br>

## Windows Docker install時のトラブルシューティング

Expand All @@ -94,7 +94,7 @@ $ python3 -c 'import torch; print(torch.__version__) '
③ Dockerイメージの取得途中で死ぬ
自宅のネットワーク回線が貧弱なのか、下記コマンドでイメージを持ってくる途中で止まる。
docker run -p 6080:80 --shm-size=512m seigott/tetris_game_docker
docker run -p 6080:80 --shm-size=512m seigott/tetris_docker
⇒ Docker for Windowsを起動して、ウィンドウ上部の"歯車(設定)ボタン"、"Docker Engine"をクリック。
  configファイルに、「"max-concurrent-download":1」を追記。
Expand All @@ -107,7 +107,7 @@ docker run -p 6080:80 --shm-size=512m seigott/tetris_game_docker
## pytorch v1.4 インストール方法

ubuntu18.04環境では、以下のようにしてインストールできることを確認済<br>
[pytorch v1.4 インストール済のDocker環境(お試し版)](https://github.com/seigot/tetris_game/blob/master/docker/README.md)を作成しました。追加で必要なものがあればDockerfileを更新して下さい。
[pytorch v1.4 インストール済のDocker環境(お試し版)](https://github.com/seigot/tetris/blob/master/docker/README.md)を作成しました。追加で必要なものがあればDockerfileを更新して下さい。

```
function install_torch(){
Expand All @@ -122,11 +122,11 @@ function install_torch(){
}
```
## Dockerはコンテナ終了の度にデータが消えて手間が掛かるので何とかしたい
[WSL(Windows Subsystem for Linux)を使う場合](https://github.com/seigot/tetris_game/blob/master/doc/files/install_windows_wsl.md)の手順を用意しました。<br>
[WSL(Windows Subsystem for Linux)を使う場合](https://github.com/seigot/tetris/blob/master/doc/files/install_windows_wsl.md)の手順を用意しました。<br>
(kyadさんありがとうございます)<br>
<br>
追記:cygwin環境構築手順<br>
[isshy-youさんによる`Cygwin Install for tetris_game`構築手順](https://github.com/isshy-you/tetris_game/wiki/Cygwin-Install-for-tetris_game)<br>
[isshy-youさんによる`Cygwin Install for tetris`構築手順](https://github.com/isshy-you/tetris/wiki/Cygwin-Install-for-tetris)<br>
(isshy-youさんありがとうございます)

### 以下、順次追記
2 changes: 1 addition & 1 deletion doc/files/GameStatus.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## `GameStatus`データ構造

[`block_controller.py`](https://github.com/seigot/tetris_game/blob/master/block_controller.py)内の`def GetNextMove(self, nextMove, GameStatus)`で扱う`GameStatus`は辞書型データです。<br>
[`block_controller.py`](https://github.com/seigot/tetris/blob/master/block_controller.py)内の`def GetNextMove(self, nextMove, GameStatus)`で扱う`GameStatus`は辞書型データです。<br>
ブロックの動きを決定するための参考データとして以下を格納しています。

```
Expand Down
12 changes: 6 additions & 6 deletions doc/files/block_controller.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
>本ページでは、[ブロック操作用プログラム](https://github.com/seigot/tetris_game/blob/master/block_controller.py)について説明を追記頂ける方を募集しています。<br>
>説明の追記方法は、[`Pull Requestを送る`](https://github.com/seigot/tetris_game#pull-requestを送るoptional)を参照下さい。<br>
>本ページでは、[ブロック操作用プログラム](https://github.com/seigot/tetris/blob/master/block_controller.py)について説明を追記頂ける方を募集しています。<br>
>説明の追記方法は、[`Pull Requestを送る`](https://github.com/seigot/tetris#pull-requestを送るoptional)を参照下さい。<br>
# ブロック操作用プログラムについて

[ブロック操作用プログラム](https://github.com/seigot/tetris_game/blob/master/block_controller.py)では、ボード情報からブロックの次の動作を決定します。<br>
[ブロック操作用プログラム](https://github.com/seigot/tetris/blob/master/block_controller.py)では、ボード情報からブロックの次の動作を決定します。<br>
このファイルの`def GetNextMove`関数にて、ボード情報`GameStatus`を入力として受け取り、次の動作決定用のデータ`nextMove`を返す事でブロックが動く仕様になっています。<br>
<br>
以下は、ボード情報`GameStatus`、次の動作決定用のデータ`nextMove`について記載します。<br>

# ボード情報
ボード情報には以下が含まれます。<br>
詳細は、[`GameStatus`データ構造](https://github.com/seigot/tetris_game/blob/master/doc/files/GameStatus.md)や、[サンプルコード](https://github.com/seigot/tetris_game/blob/master/game_manager/board_controller_sample.py)のようにGameStatusをログ出力することで確認可能です。
詳細は、[`GameStatus`データ構造](https://github.com/seigot/tetris/blob/master/doc/files/GameStatus.md)や、[サンプルコード](https://github.com/seigot/tetris/blob/master/game_manager/board_controller_sample.py)のようにGameStatusをログ出力することで確認可能です。

```
* field_info : フィールド情報
Expand Down Expand Up @@ -80,7 +80,7 @@ Index値はブロック情報を参照下さい。

尚、基準点とそれ以外の座標については現在のブロック情報(メソッド`Shape_class.getCoords()`)から取得可能です。<br>
また、各形状におけるx,y方向の最大長は、現在のブロック情報(メソッド`Shape_class.getBoundingOffsets()`)から取得可能です。<br>
取得の具体的な実装方法は、[ブロック操作用サンプルプログラム](https://github.com/seigot/tetris_game/blob/master/doc/files/block_controller_sample.md)を参照ください。
取得の具体的な実装方法は、[ブロック操作用サンプルプログラム](https://github.com/seigot/tetris/blob/master/doc/files/block_controller_sample.md)を参照ください。

## ブロック出現時の初期位置
ブロックは、ブロック操作の基準点が座標(5,1)になるように出現します。
Expand Down Expand Up @@ -129,4 +129,4 @@ Index値はブロック情報を参照下さい。
(今後ルール変更がある場合は、ルールに応じて`nextMove`もアップデートしていく予定です。)

# 使用例
[ブロック操作用サンプルプログラム](https://github.com/seigot/tetris_game/blob/master/doc/files/block_controller_sample.md)を参照ください。
[ブロック操作用サンプルプログラム](https://github.com/seigot/tetris/blob/master/doc/files/block_controller_sample.md)を参照ください。
4 changes: 2 additions & 2 deletions doc/files/block_controller_sample.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
>本ページでは、[ブロック操作用サンプルプログラム(block_controller_sample.py)](https://github.com/seigot/tetris_game/blob/master/game_manager/block_controller_sample.py)について説明を追記頂ける方を募集しています。<br>
>説明の追記方法は、[`Pull Requestを送る`](https://github.com/seigot/tetris_game#pull-requestを送るoptional)を参照下さい。<br>
>本ページでは、[ブロック操作用サンプルプログラム(block_controller_sample.py)](https://github.com/seigot/tetris/blob/master/game_manager/block_controller_sample.py)について説明を追記頂ける方を募集しています。<br>
>説明の追記方法は、[`Pull Requestを送る`](https://github.com/seigot/tetris#pull-requestを送るoptional)を参照下さい。<br>
# ブロック操作用サンプルプログラム

Expand Down
4 changes: 2 additions & 2 deletions doc/files/board_manager.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
>本ページでは、[ボード管理用プログラム](https://github.com/seigot/tetris_game/blob/master/game_manager/board_manager.py)について説明を追記頂ける方を募集しています。<br>
>説明の追記方法は、[`Pull Requestを送る`](https://github.com/seigot/tetris_game#pull-requestを送るoptional)を参照下さい。<br>
>本ページでは、[ボード管理用プログラム](https://github.com/seigot/tetris/blob/master/game_manager/board_manager.py)について説明を追記頂ける方を募集しています。<br>
>説明の追記方法は、[`Pull Requestを送る`](https://github.com/seigot/tetris#pull-requestを送るoptional)を参照下さい。<br>
# ボード管理用プログラムについて
執筆中
4 changes: 2 additions & 2 deletions doc/files/game_manager.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
>本ページでは、[ゲーム管理用プログラム](https://github.com/seigot/tetris_game/blob/master/game_manager/game_manager.py)について説明を追記頂ける方を募集しています。<br>
>説明の追記方法は、[`Pull Requestを送る`](https://github.com/seigot/tetris_game#pull-requestを送るoptional)を参照下さい。<br>
>本ページでは、[ゲーム管理用プログラム](https://github.com/seigot/tetris/blob/master/game_manager/game_manager.py)について説明を追記頂ける方を募集しています。<br>
>説明の追記方法は、[`Pull Requestを送る`](https://github.com/seigot/tetris#pull-requestを送るoptional)を参照下さい。<br>
# ゲーム管理用プログラムについて
執筆中
6 changes: 3 additions & 3 deletions doc/files/install_windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ docker for windowsを使います。<br>
[Windows10用Windows Subsystem for Linuxのインストール ガイド](https://docs.microsoft.com/ja-jp/windows/wsl/install-win10)

以下にインストール時のトラブルシューティングをまとめました。<br>
[FAQ/Windows Docker install時のトラブルシューティング](https://github.com/seigot/tetris_game/blob/master/doc/files/FAQ.md#windows-docker-install%E6%99%82%E3%81%AE%E3%83%88%E3%83%A9%E3%83%96%E3%83%AB%E3%82%B7%E3%83%A5%E3%83%BC%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0)
[FAQ/Windows Docker install時のトラブルシューティング](https://github.com/seigot/tetris/blob/master/doc/files/FAQ.md#windows-docker-install%E6%99%82%E3%81%AE%E3%83%88%E3%83%A9%E3%83%96%E3%83%AB%E3%82%B7%E3%83%A5%E3%83%BC%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0)

### step1. パワーシェル上でコンテナを起動する<br>

`Windowsボタン`から`Windows PowerShell`を起動してterminalから以下実行する。<br>
コンテナのダウンロード〜起動が完了するまで少し待つ。<br>

```
docker run -p 6080:80 --shm-size=512m seigott/tetris_game_docker
docker run -p 6080:80 --shm-size=512m seigott/tetris_docker
```

### step2. ブラウザからdockerコンテナにアクセスする
Expand All @@ -32,7 +32,7 @@ localhost:6080
Terminalを立ち上げて以下を実行

```
cd ~/tetris_game
cd ~/tetris
bash start.sh
```

Expand Down
8 changes: 4 additions & 4 deletions doc/files/install_windows_wsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ Step 2 でインストールしたXサーバを起動する。
1. スタートメニューやデスクトップのショートカットからVcXsrvを起動する。
2. 「次へ」を3回押して、「完了」を押すとXサーバが起動する。

## Step 5. tetris_gameの起動
## Step 5. tetrisの起動

### ソースコードを取得する(初回のみ必要)

```
git clone https://github.com/seigot/tetris_game
git clone https://github.com/seigot/tetris
```

### tetris_gameを実行する
### tetrisを実行する
```
cd ~/tetris_game
cd ~/tetris
bash start.sh
```

Expand Down
2 changes: 1 addition & 1 deletion doc/files/reference_score.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| --- | --- | --- | --- | - |
| random | -916 | -731 | -4948 | - |
| sample(bash start.sh -s y) | 6935 | 6259 | 3737 | - |
| [kyadさん作の無限テトリス](https://github.com/kyad/tetris_game/blob/forever-branch/forever.md) | - | - | - | 20617 |
| [kyadさん作の無限テトリス](https://github.com/kyad/tetris/blob/forever-branch/forever.md) | - | - | - | 20617 |
| 理論値 | 23400+落下ボーナス | - | - | - |

理論値は「(全てI字の棒が出るなどして)全て4ライン消しをした場合」を想定。<br>
Expand Down
Loading

0 comments on commit 98fd882

Please sign in to comment.