piny940 / python-reverse Goto Github PK
View Code? Open in Web Editor NEWPythonでオセロを作ってみた
Pythonでオセロを作ってみた
モードってのはCPUモードかPvPモードかってこと
色を引数にとって、その色の石を置ける場所(座標)のリストを返す関数と、
引数なしで現在のプレイヤーが置ける場所のリストを返す関数があるとよさそう?
プレイヤーが石を置ける場所を、ハイライトするのに必要
現状、controller.pyから石の数にアクセスするには
self.__reversi.get_board().get_white_stone_counts()
とする必要があって大変。
あと、引数の数を減らすために、石の数は
{ Stone.White: m, Stone.Black: n }
の形で渡したいと思っている(各石の数はView.create_windowの引数にも渡す必要があるが、白い石の数と黒い石の数を分けて渡すとなると引数が多くなるし引数の名前も長くなるので1つの変数にまとめてしまいたいから)ので、この形で石の数を返す関数を作ってほしい(controller.pyから石の数にアクセスする場面は現状2箇所あり、その2箇所でわざわざdictionaryにまとめる処理を書くのは大変)
大部分は書けるようになったはず
まだ書けない部分(=controller.pyに足りてない関数)がある場合はissueに投げといてください
表題の通りです。
関数名はどんなのが良いんだろう。request_notify_player_wins(self, color)
みたいな感じかな?
tests/
ディレクトリに置いていくとりあえずこれで書き始めてしまったんですけどこれでよろしいですか、というお伺いと、あと他にも規約みたいなので追加すべきものがあればコメントしてくださいというお話です。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.