Skip to content

Instantly share code, notes, and snippets.

@yoshiki-0428
Last active July 25, 2018 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoshiki-0428/47a50ac23ed5a1ef81ef6b95f5978a3b to your computer and use it in GitHub Desktop.
Save yoshiki-0428/47a50ac23ed5a1ef81ef6b95f5978a3b to your computer and use it in GitHub Desktop.
じゃんけんゲームの仕様

じゃんけんげーむを作成してみる

仕様

  • python起動時にユーザの1:グー 2:チョキ 3:パーを入力
  • コンピュータの手をランダムで1:グー 2:チョキ 3:パーを設定する
  • Enter押下でコンピュータの手(1:グー 2:チョキ 3:パー)とジャッジをし勝敗を表示

使用ライブラリ

  • random

以下実行イメージ

$ python3 Janken.py
あなたの手を入力してください
(1:グー 2:チョキ 3:パー)->2
コンピュータ:パー
あなたの勝ち

作成条件

  • pythonのクラスを使用して作成してください(最低1クラス -> じゃんけんの手に関するクラス)
  • コンピュータの手はrandom関数を使用して算出してください
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment