Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-10-22 (23 hours ago) | Not enough user ratings | Total: 2 This week: 2 | All time: 11,465 This week: 23 |
Version | License | PHP version | Categories | |||
tower_of_hanoi 1.0 | The PHP License | 7 | Games, Web services, PHP 7 |
Description | Author | |
This package can implement the Tower of Hanoi game on the Web. |
<?php |
<h1 align="center">Tower of Hanoi</h1> <p align="center"> A simple pyramid puzzle</p>
<p> </p>
> Application Requirements * PHP >= 8.2 * A web server like Apache or Nginx * Composer for dependency management.
git clone https://github.com/infinitypaul/tower_of_hanoi.git projectname
composer install
php artisan serve
<p> </p>
Enjoy!
Notes: - http://localhost:8000/ is your base URL. Replace it with your server's base URL if necessary. - No persistence is needed across requests. The game resets if the server restarts.
GET http://localhost:8000/api/state
Description: Retrieves the current state of the Tower of Hanoi game, including the positions of the disks on the rods and whether the game is over.
POST http://localhost:8000/api/move/{from}/{to}
Description: Moves a disk from one rod (from) to another rod (to).
Where: * {from}: The rod from which you want to move a disk (1-based index). * {to}: The rod to which you want to move the disk (1-based index).
php artisan test
You should see the results of the tests, ensuring that the application works as expected.
This project uses PHPStan for static code analysis to ensure code quality and prevent errors
vendor/bin/phpstan analyse
The Tower of Hanoi is open-sourced software licensed under the MIT license
Files (51) |
File | Role | Description | ||
---|---|---|---|---|
app (4 directories) | ||||
bootstrap (2 files) | ||||
config (11 files) | ||||
database (3 directories) | ||||
public (3 files) | ||||
resources (3 directories) | ||||
routes (3 files) | ||||
tests (1 file, 2 directories) | ||||
.editorconfig | Data | Auxiliary data | ||
.env.example | Data | Auxiliary data | ||
artisan | Example | Example script | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
package.json | Data | Auxiliary data | ||
phpstan.neon | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
postcss.config.js | Data | Auxiliary data | ||
README.md | Doc. | Documentation | ||
tailwind.config.js | Data | Auxiliary data | ||
vite.config.js | Data | Auxiliary data |
Files (51) | / | app |
Files (51) | / | app | / | Http | / | Controllers |
File | Role | Description |
---|---|---|
Controller.php | Class | Class source |
TowerOfHanoiController.php | Class | Class source |
Files (51) | / | bootstrap |
File | Role | Description |
---|---|---|
app.php | Example | Example script |
providers.php | Class | Class source |
Files (51) | / | config |
File | Role | Description |
---|---|---|
app.php | Aux. | Configuration script |
auth.php | Class | Class source |
cache.php | Aux. | Configuration script |
database.php | Aux. | Configuration script |
filesystems.php | Aux. | Configuration script |
logging.php | Class | Class source |
mail.php | Aux. | Configuration script |
queue.php | Aux. | Configuration script |
sanctum.php | Class | Class source |
services.php | Aux. | Configuration script |
session.php | Aux. | Configuration script |
Files (51) | / | database |
File | Role | Description | ||
---|---|---|---|---|
factories (1 file) | ||||
migrations (4 files) | ||||
seeders (1 file) |
Files (51) | / | database | / | migrations |
File | Role | Description |
---|---|---|
0001_01_01_000000_create_users_table.php | Class | Class source |
0001_01_01_000001_create_cache_table.php | Class | Class source |
0001_01_01_000002_create_jobs_table.php | Class | Class source |
2024_10_16_233428_...ss_tokens_table.php | Class | Class source |
Files (51) | / | public |
File | Role | Description |
---|---|---|
.htaccess | Data | Auxiliary data |
index.php | Example | Example script |
robots.txt | Doc. | Documentation |
Files (51) | / | resources | / | js |
File | Role | Description |
---|---|---|
app.js | Data | Auxiliary data |
bootstrap.js | Data | Auxiliary data |
Files (51) | / | routes |
File | Role | Description |
---|---|---|
api.php | Appl. | Application script |
console.php | Appl. | Application script |
web.php | Appl. | Application script |
Files (51) | / | tests |
File | Role | Description | ||
---|---|---|---|---|
Feature (2 files) | ||||
Unit (2 files) | ||||
TestCase.php | Class | Class source |
Files (51) | / | tests | / | Feature |
File | Role | Description |
---|---|---|
ExampleTest.php | Class | Class source |
TowerOfHanoiTest.php | Class | Class source |
Files (51) | / | tests | / | Unit |
File | Role | Description |
---|---|---|
ExampleTest.php | Class | Class source |
TowerOfHanoiControllerTest.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.