-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
# Rock Paper Scissors | ||
|
||
## Example | ||
An example package used to demonstrate dependencies in [DGMD E-2 Web Programming for Beginners with PHP](https://hesweb.dev/e2). | ||
|
||
|
||
|
||
## Installation | ||
```php | ||
composer require susanbuck/rock-paper-scissors | ||
``` | ||
|
||
|
||
## Usage | ||
```php | ||
require __DIR__.'/vendor/autoload.php'; | ||
|
||
use RPS\Game; | ||
|
||
$game = new Game(); | ||
|
||
# Eack invocation of the `play` method will play and track a new round of player (given move) vs. computer | ||
$game->play('rock'); | ||
$game->play('paper'); | ||
$game->play('scissors'); | ||
|
||
var_dump($game->getResults()); | ||
# An array of the results for each round (player move, computer move, whether player won) can be accessed from the `getResults` method | ||
var_dump($game->getResults()); | ||
``` |