4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[PHP]じゃんけんプログラム

Last updated at Posted at 2021-02-24

未経験でシステムエンジニアとして新卒入社し、もうすぐ1年です。
が、エンジニアとして成長できているか不安だったのでこれから少しずつ勉強し
このQiitaにアウトプットしていきます。

[PHP]じゃんけんプログラム

ロジック部分

```php
<h4>学んだこと</h4>
・if文の条件「~かつ~の場合 または ~かつ~の場合、、、」は下記で記述が可能

```php
elseif($player_hand == "グー" && $pc_hand == "チョキ" || $player_hand == "チョキ" && $pc_hand == "パー" || $player_hand == "パー" && $pc_hand == "グー")

・配列からランダムで値を取得


$pc_hand = $pc_hands[array_rand($pc_hands)];
4
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?