Enviar pesquisa
Carregar
ソフトウェア制作実験「脳トレしりとりゲーム」
•
Transferir como PPTX, PDF
•
0 gostou
•
193 visualizações
T
TomomiKondo
Seguir
4文字のひらがなを入力し、対戦するしりとりゲームです。
Leia menos
Leia mais
Software
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 20
Baixar agora
Recomendados
実用Brainf*ckプログラミング入門編
実用Brainf*ckプログラミング入門編
京大 マイコンクラブ
単体テストのすゝめ
単体テストのすゝめ
Li Satoshi
Smalltalkでじゃんけん
Smalltalkでじゃんけん
Masashi Umezawa
Php勉強会資料20090629
Php勉強会資料20090629
Takako Miyagawa
可読性について リーダブルコード Part4(優れたテストコード1)
可読性について リーダブルコード Part4(優れたテストコード1)
tak
可読性について リーダブルコード part1(表面上の改善)
可読性について リーダブルコード part1(表面上の改善)
tak
TwitterのStreaming ApiをPhpから使う
TwitterのStreaming ApiをPhpから使う
Hidenori Goto
The FizzBuzz Programing Contest
The FizzBuzz Programing Contest
Junichi Ito
Recomendados
実用Brainf*ckプログラミング入門編
実用Brainf*ckプログラミング入門編
京大 マイコンクラブ
単体テストのすゝめ
単体テストのすゝめ
Li Satoshi
Smalltalkでじゃんけん
Smalltalkでじゃんけん
Masashi Umezawa
Php勉強会資料20090629
Php勉強会資料20090629
Takako Miyagawa
可読性について リーダブルコード Part4(優れたテストコード1)
可読性について リーダブルコード Part4(優れたテストコード1)
tak
可読性について リーダブルコード part1(表面上の改善)
可読性について リーダブルコード part1(表面上の改善)
tak
TwitterのStreaming ApiをPhpから使う
TwitterのStreaming ApiをPhpから使う
Hidenori Goto
The FizzBuzz Programing Contest
The FizzBuzz Programing Contest
Junichi Ito
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Mais conteúdo relacionado
Destaque
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Destaque
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
ソフトウェア制作実験「脳トレしりとりゲーム」
1.
ソフトウェア制作実験 「脳トレしりとりゲーム」 3班 / 1W182141-0
近藤智美
2.
作成したプログラム の概要
3.
概要 4文字縛り、相手の単語の最後の二文字から始まる言葉を答える というルールのしりとりゲーム 自分側で開くmyShiritori.javaと対戦相手が実行するoppShiritori.java、そして ゲームの機能の構成要素としてGame.java、Player.java、Judge.java、 Message.javaを作成 ひらがなのみを打ち込んで解答 相手の単語が日本語に存在しないと考えた場合、自分のターンに「審議」と入 力することで相手の単語を変えさせることができる 日本語が含まれるため、コンパイル時にUTF8でエンコードする必要がある (javac -encoding UTF-8
○○.java)
4.
Messageクラス 勝ち負けの文章をString型で返す関数 ルール説明を表示させる関数
ゲームのように、文章を一文字ずつ時間差で表示する関数
5.
Judgeクラス 引数で与えられた単語 を解析する エラー番号をクラス変数で記憶 「審議」の時 ErrorNum
= 0 4文字でないとき ErrorNum = 1 しりとりになっていない もしくは3文字目が”ん”のとき ErrorNum = 2
6.
Playerクラス プレイヤーに関する関数 を持つクラス 順番を決めるための乱数 生成も行う 生成した乱数を格納 自分の順番を記憶 キーボードで入力された 名前をnameに格納 一番最近自分が送った単語 もし入力が「審議」だった場合 審議の前に入力していた単語をxに コピーしておく
7.
Gameクラス ゲーム進行に必要な機 能を持つ 自分と相手のPlayerオブジェクトを格納 ゲームの状態を格納 (-1ならクライアント側の勝ち、2ならサーバー側の勝ち、 100なら審議発令中) 乱数生成と先攻後攻の決定 Gameが作成されると自分と相手のPlayerを作成し、 自分の名前を登録させる 最初の単語を”しりとり”にセット 相手の単語をJudgeクラスで解析させて、statusを更新
8.
myShiritori.java ープログラムの 流れー • サーバー側としてソケッ ト通信を行う 順番に必要な機能を呼び 出していく 1.
ソケット通信の開始 2. ゲームオブジェクトを作成(同時に名前の登録が行われる) 3. ルール説明が流れる 4. 乱数を用いて先攻後攻を決め、相手にも同じメッセージを送信 5. 最初の単語を「しりとり」に設定 6. 相手が送った単語が正しいか判定 7. ゲームステータスに応じて条件判断 8. クライアント側に今から何をするかを送信 9. 条件に応じてメッセージを送受信 10. 勝敗が決まったらエラーメッセージを表示してゲーム終了 (通信も終了する)
9.
myShiritori.java ープログラム前半ー ポート番号は8080で固定 エラー文を配列に格納しておく ゲームオブジェクトの作成 相手の名前を通信で受け取る
10.
myShiritori.java ープログラム後半ー (一部) 相手の単語がルール通りかチェック ゲームのステータスを確認 これから何をするのかを クライアントに送る 相手の入力を登録
11.
oppShiritori.java ープログラムの 流れー • クライアント側としてソ ケット通信を行う ゲームに関する処理は行わ ない
送られたメッセージの表示 と自分の情報の送信のみ 1. サーバーに接続 2. 自分の名前を入力してサーバーに送る 3. ルール説明が流れる 4. 決定した順番や最初の文字はしりとりだという、サーバーから送 られてきたメッセージを表示 5. サーバーから次に何を行うかのメッセージを受け取る 6. メッセージに応じて条件分岐し、受け取ったメッセージを表示し たり自分の入力を送信したりする 7. finishが送られてくると終了動作に入る 8. 最後に勝ち負けのメッセージを受信し、表示して通信を終了する
12.
oppShiritori.java ープログラム前半ー (一部) ポート番号は8080で固定 同じLAN内のPCで対戦することも可 自分の名前を登録・送信
13.
oppShiritori.java ープログラム後半ー (一部) 相手のターンの場合 サーバーからの指示を待つ 自分のターンの場合 自分か相手のどちらかが間違った単語を 送信した場合 相手が「審議」を送信した場合 自分が「審議」を送信した場合
14.
作成したプログラム の実行
15.
実行環境 Windows 10
Pro バージョン 1909 Visual Studio Code バージョン 1.45.1 java version "14.0.1" ターミナルを分割して実行
16.
順番が決定するまで
17.
サーバー側のプログラムを実行 対戦相手の名前が表示されている クライアント側のプログラムを実行 ルール説明が1文字ずつ時間差で現れる どちらが先攻後攻か表示されている
18.
入力からゲーム終了(文字数が違う) 1. サーバー側が入力(先攻) 2. サーバー側の入力が表示される 3.
クライアント側が入力(後攻) 4. クライアント側の入力が表示される 5. クライアント側がおかしな単語を送信 6. サーバー側が「審議」を発令 7. 「審議」がうまく動作した旨のメッセージ 8. 相手が審議を 申し立てた旨の通知 9.新しい単語を送信 10.文字数の異なる単語を送信 11.エラー文と勝敗メッセージの表示
19.
入力からゲーム終了(しりとりになっていない) 最後の2文字から始まらない 言葉を返してしまった 3文字目が「ん」である 言葉を返してしまった
20.
工夫した ところ サーバー側でゲームを進行させ、クライアント側はopp.java とMessage.javaだけあれば実行できるようにした 「審議」機能を実装することで、相手にずるさせないように した 見た目を楽しく読みやすくするため、ルール説明の文章は RPGゲームのように、一文字ずつ順に表示させるようにした クライアント側に今から何をするかを送信することで、正常 に文字のやり取りができるようにした ゲームオブジェクトにステータスを表す変数を持たせること で、次に何を実行するかを末端のクラスからサーバーに伝え るのが容易になった
Baixar agora