PHP Classes

How to Use a PHP Game Engine to Play the Dinobot Game using the Package Dinobot on Tabletop Game: Play the Dinobot game on the terminal console

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-08-04 (3 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 17 This week: 17All time: 11,307 This week: 4Up
Version License PHP version Categories
dinobot-on-tabletop- 1.0GNU General Publi...8Games, Console, PHP 8
Description 

Author

This package allows you to Play the Dinobot game on the terminal console.

It allows people to play the Dinobot game by entering commands that define the player's moves.

The game can report the player's position in the game as a response to the report command.

Picture of Pierre-Henry Soria
  Performance   Level  
Name: Pierre-Henry Soria <contact>
Classes: 47 packages by
Country: United Kingdom
Innovation award
Innovation award
Nominee: 17x

Winner: 3x

Example

#!/usr/bin/env php
<?php declare(strict_types=1);

@
set_time_limit(0);
@
ini_set('memory_limit', '528M');

require_once
dirname(__DIR__) . '/vendor/autoload.php';

use
App\Command\ToyCommand;
use
Symfony\Component\Console\Application;

$app = new Application();

$toy = new ToyCommand();
$app->add($toy);
$app->setDefaultCommand($toy->getName(), true);

$app->run();


Details

Dinobot Robot Simulator ?

Dinobot - Draft

Usage

Open a console and execute php bin/toy, a prompt character (>) will be shown. Available command:

  • `place x,y,face` \ will put the toy robot on the table in position `x`, `y` and facing `north`, `south`, `east`, or `west`. This command should called first before another command. You cannot place a toy robot beyond the barrier.
  • `move` \ will move the toy robot one unit forward in the direction it is currently facing.
  • `left` or `right` \ will rotate the robot 90 degrees in the specified direction without changing the position of the robot.
  • `path` \ will give the path to take from the current position to a specific destination. e.g. `path 0,1`
  • `q` \ Exit the prompt.

Example:\ ![](./example.png)

Development

  1. Fork and clone this repo.
    git clone git@github.com:pH-7/dinobot-on-tabletop-game.git
    
  2. Install all dependencies
    composer install
    
  3. Install development tools using `phive`
    phive install
    
  4. Before commit the change, make sure there are no coding style or `phpstan` violations by executing
    vendor/bin/phpcs
    tools/phpstan analyse
    
  5. Run unit testing by executing
    php bin/phpunit
    
  6. Unit testing coverage report
    php bin/phpunit --coverage-text
    

Screenshots (4)  
  • dinobot-draft.jpeg
  • example-results-path-finder.png
  • example-results-with-path-finder.png
  • example.png
  Files folder image Files (49)  
File Role Description
Files folder imagebin (3 files)
Files folder imageconfig (5 files, 2 directories)
Files folder imagepublic (1 file)
Files folder imagesrc (1 file, 6 directories)
Files folder imagetests (1 file, 1 directory)
Accessible without login Plain text file .env.dist Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file docker-compose.override.yml Data Auxiliary data
Accessible without login Plain text file docker-compose.yml Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpcs.xml.dist Data Auxiliary data
Accessible without login Plain text file phpstan.neon.dist Data Auxiliary data
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file symfony.lock Data Auxiliary data

  Files folder image Files (49)  /  bin  
File Role Description
  Plain text file console Class Class source
  Accessible without login Plain text file phpunit Data Auxiliary data
  Accessible without login Plain text file toy Example Example script

  Files folder image Files (49)  /  config  
File Role Description
Files folder imagepackages (5 files, 2 directories)
Files folder imageroutes (1 file, 1 directory)
  Plain text file bootstrap.php Class Class source
  Plain text file bundles.php Class Class source
  Accessible without login Plain text file preload.php Aux. Configuration script
  Accessible without login Plain text file routes.yaml Data Auxiliary data
  Accessible without login Plain text file services.yaml Data Auxiliary data

  Files folder image Files (49)  /  config  /  packages  
File Role Description
Files folder imageprod (2 files)
Files folder imagetest (2 files)
  Accessible without login Plain text file cache.yaml Data Auxiliary data
  Accessible without login Plain text file doctrine.yaml Data Auxiliary data
  Accessible without login Plain text file doctrine_migrations.yaml Data Auxiliary data
  Accessible without login Plain text file framework.yaml Data Auxiliary data
  Accessible without login Plain text file routing.yaml Data Auxiliary data

  Files folder image Files (49)  /  config  /  packages  /  prod  
File Role Description
  Accessible without login Plain text file doctrine.yaml Data Auxiliary data
  Accessible without login Plain text file routing.yaml Data Auxiliary data

  Files folder image Files (49)  /  config  /  packages  /  test  
File Role Description
  Accessible without login Plain text file doctrine.yaml Data Auxiliary data
  Accessible without login Plain text file framework.yaml Data Auxiliary data

  Files folder image Files (49)  /  config  /  routes  
File Role Description
Files folder imagedev (1 file)
  Accessible without login Plain text file annotations.yaml Data Auxiliary data

  Files folder image Files (49)  /  config  /  routes  /  dev  
File Role Description
  Accessible without login Plain text file framework.yaml Data Auxiliary data

  Files folder image Files (49)  /  public  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files (49)  /  src  
File Role Description
Files folder imageCommand (1 file)
Files folder imageData (2 files)
Files folder imageEntity (1 file)
Files folder imageException (1 file)
Files folder imageRepository (1 file)
Files folder imageService (3 files)
  Plain text file Kernel.php Class Class source

  Files folder image Files (49)  /  src  /  Command  
File Role Description
  Plain text file ToyCommand.php Class Class source

  Files folder image Files (49)  /  src  /  Data  
File Role Description
  Plain text file InputDto.php Class Class source
  Plain text file Vector.php Class Class source

  Files folder image Files (49)  /  src  /  Entity  
File Role Description
  Plain text file Robot.php Class Class source

  Files folder image Files (49)  /  src  /  Exception  
File Role Description
  Plain text file InvalidPositionException.php Class Class source

  Files folder image Files (49)  /  src  /  Repository  
File Role Description
  Plain text file RobotRepository.php Class Class source

  Files folder image Files (49)  /  src  /  Service  
File Role Description
  Plain text file InputParser.php Class Class source
  Plain text file RobotAction.php Class Class source
  Plain text file Tabletop.php Class Class source

  Files folder image Files (49)  /  tests  
File Role Description
Files folder imageUnit (3 files)
  Plain text file bootstrap.php Class Class source

  Files folder image Files (49)  /  tests  /  Unit  
File Role Description
  Plain text file InputParserTest.php Class Class source
  Plain text file RobotActionTest.php Class Class source
  Plain text file TabletopTest.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 Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:17
This week:17
All time:11,307
This week:4Up