Giter Club home page Giter Club logo

pokedex's Introduction

Prérequis

  • Java >= 8
  • SBT >= 1.6.0

Sujet

Il s'agit d'implémenter un pokedex en ligne de commande en utilisant l'API https://pokeapi.co/

Les commandes qui sont à implémentées sont:

  • GET
  • GETALL <region?> <pokemon-type1?> <generation?> <legendary?>
  • WHEREIS
  • MATCH

Description des commandes :

GET

Affiche les informations du pokémon si trouvé. Si le pokémon n'existe pas, affichez un message d'erreur.

Informations à afficher:

  • nom
  • type 1
  • type 2
  • attack
  • def
  • SP attack
  • SP defense
  • legendary
  • generation
  • moveset
  • evolution path

GETALL <pokemon-type1?> <generation?> <legendary?>

Récupère tous les pokémons qui corresponde aux critères de recherches. Les critères de recherche peuvent être:

  • pokemon type 1 (fire, grass, water, ...)

  • generation (1, 2, 3, ...)

  • legendary (true or false)

  • WHEREIS

Affiche les différents lieux où le pokémon peut-être vu. Si le pokémon n'existe pas, affichez un message d'erreur.

  • MATCH

Affiche tous les noms de pokémon qui match avec le mot clé.

Consignes:

  • Utilisez au maximum l'approche fonctionnelle dans votre implémentation
  • Pas de class mutable (sauf cache)
  • Pas de null, utilisez plutôt Option
  • Rate-limit(3 per seconds) pour éviter trop de calls API successif. (sinon risque de ban IP par pokédex API)
  • Essayez d'utiliser au maximum les collections de la librairie standard
  • Préférez Either pour les erreurs plutôt que les exceptions
  • Séparation des fonctions pure et impure
  • Gestion d' erreur en cas de paramètre invalide

Bonus:

  • Tests unitaires avec scalatest
  • Utilisation de monix tasks pour encapsuler les side-effects (I/O).
  • Ajout de commande supplémentaire.
  • Ajout de cache
  • Génération d'un roaster pokémon (6 pokémon aléatoire)
  • Abstraction de pokémon API pour pouvoir tester facilement votre programme sans faire de call API. (Utilisation d'injection de dépendance)
  • Proposer une nouvelle version du pokédex en API à la place d'un CLI

Resources

https://pokeapi.co/docs/v2 https://www.scala-exercises.org/scala_tutorial/terms_and_types https://www.scala-exercises.org/std_lib/asserts https://docs.scala-lang.org/scala3/book/introduction.html https://square.github.io/okhttp/ https://github.com/spray/spray-json https://monix.io/docs/3x/eval/task.html https://blog.appsignal.com/2022/02/16/dependency-injection-in-javascript-write-testable-code-easily.html

pokedex's People

Contributors

rimama44 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.