Giter Club home page Giter Club logo

pokemon-game-in-terminal's Introduction

Pokemon Game in the Terminal with JavaScript

This is a simple Pokemon game that can be played in the terminal. The game involves two players choosing a trainer each and taking turns to make moves to try to defeat each other's Pokemon. Players select their moves hitting key combinations, and the results are displayed on the screen.

This README.md file provides information on how to play the game. Please read the instructions below before downloading and playing the game.

Installation

To use this game, you will need to have Node.js and npm installed on your machine. You can download and install both from their official websites.

Once you have Node.js and npm installed, you can follow these steps to install and run the game:

  1. Clone the repository to your local machine using the following command:
git clone [email protected]:brt-yilmaz/pokemon-game-in-terminal.git
  1. Navigate to the directory where you have downloaded/cloned this game.

  2. Install the required dependencies using the following command:

npm install
  1. Wait for the packages to install. Once they are installed, you can run the game with the following command.
npm start

Usage

Using without ES6 Modules

To use readline-sync and chalk, you need to require them in your JavaScript file:

const readlineSync = require("readline-sync");
const chalk = require("chalk");

After requiring them, you can use their functions in your code.

Here is an example of using readline-sync to get user input:

const name = readlineSync.question("What is your name? ");
console.log(`Hello, ${name}!`);

And here is an example of using chalk to style text:

console.log(chalk.red("This text is red."));
console.log(chalk.green.bold("This text is bold and green."));

Using with ES6 Modules

If you have selected "type: module" in your package.json file, you can use ES6 module syntax to import readline-sync and chalk in your code.

Here is an example of importing readline-sync and chalk as ES6 modules:

import readlineSync from "readline-sync";
import chalk from "chalk";

const name = readlineSync.question("What is your name? ");
console.log(`Hello, ${name}!`);

console.log(chalk.red("This text is red."));
console.log(chalk.green.bold("This text is bold and green."));

For more information on using ES6 modules, please refer to the Node.js documentation page on ES modules. ES6 modules documentation page.

These are just a few examples of how you can use readline-sync and chalk in your code. For more information and examples, please refer to their respective documentation pages.

pokemon-game-in-terminal's People

Contributors

brt-yilmaz avatar

Stargazers

 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.