1 / 10

オセロな日々・・・

オセロな日々・・・. メンバー リーダー・・佐藤 嶺樹 プログラマー・・・田島 佑輔 エキストラ1・・・中島 健護 エキストラ2・・・嶋村 剛士 エキストラ3・・・山谷 悠. 我々のオセロ作成は 慣れないプログラミング言語 Java との戦いとなった・・・. 中島は 常に的確な指示でリーダーを リードした. プログラマー田島は 連日の徹夜作業に追われた・・・. しまむら. みねき. さんや. 次々と倒れゆく仲間たち. プログラミングの道のり

amos-duran
Download Presentation

オセロな日々・・・

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. オセロな日々・・・ メンバー リーダー・・佐藤 嶺樹 プログラマー・・・田島 佑輔 エキストラ1・・・中島 健護 エキストラ2・・・嶋村 剛士 エキストラ3・・・山谷 悠

  2. 我々のオセロ作成は 慣れないプログラミング言語 Javaとの戦いとなった・・・

  3. 中島は 常に的確な指示でリーダーを リードした

  4. プログラマー田島は 連日の徹夜作業に追われた・・・

  5. しまむら みねき さんや 次々と倒れゆく仲間たち

  6. プログラミングの道のり 今回はjavaによる、オセロのプログラミングに挑戦した。ただし、javaに関してはほぼ、未知の領域なので、どこかからオセロのソースコードを取ってきて、それを改造することにした。と言う訳で、今回は牧瀬 芳太郎さんのオセロのページ(http://homepage3.nifty.com/ymakise/java/OthelloApplet/)からソースコードを頂いた。改造した思考ルーチンはManyReversePlayerである。

  7. 最小・最大プログラム(抜粋、一部省略) int minCount = 60, maxCount = -1, maxX = 0, maxY = 0; int Empty = board.countPieces(OthelloBoard.EMPTY); for (int y = 0; y < 8; y++) for (int x = 0; x < 8; x++) int count = board.countReversiblePieces(x, y, myColor); if (Empty > 10) if (0 < count) if (count < minCount) minCount = count; maxX = x; maxY = y; if (Empty <= 10) if (count > maxCount) maxCount = count; maxX = x; maxY = y;

  8. “隅っこでの枚数補正プログラム”追加後(抜粋、一部省略)“隅っこでの枚数補正プログラム”追加後(抜粋、一部省略) int minCount = 1000, maxCount = -1, huka1 = 0, huka2 = 0, maxX = 0, maxY = 0; int Empty = board.countPieces(OthelloBoard.EMPTY); for (int y = 0; y < 8; y++) for (int x = 0; x < 8; x++) int count = board.countReversiblePieces(x, y, myColor); ・・・次ページに続く

  9. /*4隅を優先してとる*/ if (x == 0) { if (y == 0){huka1=-100;} } if (x == 7) { if (y == 0){huka1=-100;} } ・・・省略 /*4隅の周辺は他がとれるならとらない*/ if (x == 1) { if (y == 0){huka2=100;} } if (x == 0) { if (y == 1){huka2=100;} }              ・・・省略 ・・・次ページに続く

  10. /*コマが55個以上置かれるまでその回で出来るだけ少なくとる*//*コマが55個以上置かれるまでその回で出来るだけ少なくとる*/ if (Empty > 10) { if (0 < count) { if (count + huka1 + huka2 <= minCount) { minCount = count + huka1 + huka2; maxX = x; maxY = y;}}} huka1 = 0; huka2 = 0; /*コマが55個以上置かれたときその回で出来るだけ多くとる*/ if (Empty <= 10) { if (count > maxCount) { maxCount = count; maxX = x; maxY = y; }}

More Related