Giter Site home page Giter Site logo

hw05's Introduction

HW05

Guidelines

all these exercises must be done in node files

Json Formatter

given many strings with the format of "itemName,Price,Quantity,Description,tax_percent,type" you can import them from the file names.js as an Array.

we need these information to be seprated into an object type format, so we could use it for other uses (like displaying them in a web page), write a program that takes many strings and transforms them into a Json File with the following structure.

{
    product_name:itemName,
    total_price:Price*Quantity*(1-tax_percent)
    type:type
    compound_name:itemName-total_price
}

Bonus

Write the output file into the same directroy as product.json (you may use any packages for this)

Chess Board Visualizer

In chess Programming to represent a board state at any given moment there's format called FEN string board representation string it works as follows: Lowercase letters describe the black pieces, "p" stands for pawn, "r" for rook, "n" for knight, "b" for bishop, "q" for queen, and "k" for king. The same letters are used for the white pieces, but they appear in uppercase Empty squares are denoted by numbers from one to eight, depending on how many empty squares are between two pieces.

so for example this String:
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR"
Gives us the following board

Chess Starting Board

and this String:
"r1b1k1nr/p2p1pNp/n2B4/1p1NP2P/6P1/3P1Q2/P1P1K3/q5b1."
Gives us the following board

Chess Complex Board

using the previous application from HW02 (you can change it to become more general, but please import it from another file and use it in this exercise) use that board implementation to extend it's functionality to interpret the string and print the correct board state on the board.

to check your solution import the chessBoardStates.json for more example games

for more info the FEN format, check out this link

hw05's People

Contributors

ahmedalamoudi192 avatar yazeedalhanaki 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.