定制 danielson/capture-pokemon 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

danielson/capture-pokemon

Composer 安装命令:

composer require danielson/capture-pokemon

包简介

A game of capturing pokemon passing on houses from directions from the user

README 文档

README

A game of capturing pokemons giving directions to the player. The user send a sequence of characters giving directions as this one:

  • N -> player goes north;
  • S -> player goes south;
  • O -> player goes west;
  • E -> player goes east;
  • Any other letter player stand still

Each direction take, the player captures a pokemon. But if the player goes into a direction that he already went, then no pokemons captured.

The game returns the number of pokemons that the player took after walking in all those directions.

How to use it

// import the package
use danielsonsilva\CapturePokemon\PokemonGame;

// Create your object
$pokemonGame = new PokemonGame();

// create your paths using the four options provided
$pathOne = "NSOOEESNN";
$pathTwo = "OESSSNNEE";

// Then let the player walk in those directions
$numberCapturedPokemon1 = $pokemonGame->walkDirections($pathOne);
$numberCapturedPokemon2 = $pokemonGame->walkDirections($pathTwo);

// get the number of pokemons
echo $numberCapturedPokemon1; // 5
echo $numberCapturedPokemon2; // 7

Version History

v 1.1.1

  • Reset ash position before walking directions

v 1.1.0

  • Added private functions: resetMap
  • Added a public function to get the current map from the object
  • Fix a bug when walking two times without reseting the map

v 1.0.1

  • Changed some composer.json properties

v 1.0.0

  • Package danielsonsilva/CapturePokemon created;
  • Features: walk directions provided to determine number of pokemons captures
  • Unit tests to check its effectiveness, memory usage and performance

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固