Giter Site home page Giter Site logo

hand-challenge's Introduction

Introduction

You find a strange mirror that always shows a hand that is moving. The hand appears to be alive, and after a lot of questions of "yes" and "no" answer, you know that the hand is trying to teach you a program that is written in HPL (Hand Programming Language).

This language works with a memory of an indefinite size of bytes, with all values initialized to 0. This language haves 7 instructions:

๐Ÿ‘‰ : moves the memory pointer to the next cell

๐Ÿ‘ˆ : moves the memory pointer to the previous cell

๐Ÿ‘† : increment the memory cell at the current position

๐Ÿ‘‡ : decreases the memory cell at the current position.

๐Ÿคœ : if the memory cell at the current position is 0, jump just after the corresponding ๐Ÿค›

๐Ÿค› : if the memory cell at the current position is not 0, jump just after the corresponding ๐Ÿคœ

๐Ÿ‘Š : Display the current character represented by the ASCII code defined by the current position.

Notes:

  • As memory cells are bytes, from 0 to 255 value, if you decrease 0 you'll get 255, if you increment 255 you'll get 0.
  • Loops of ๐Ÿคœ and ๐Ÿค› can be nested.

Tests

The hand shows you two small programs and their outputs:

This program display "Hello"

๐Ÿ‘‡๐Ÿคœ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘ˆ๐Ÿค›๐Ÿ‘‰๐Ÿ‘‡๐Ÿ‘Š๐Ÿ‘‡๐Ÿคœ๐Ÿ‘‡๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘ˆ๐Ÿค›๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘†๐Ÿ‘Š๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘Š๐Ÿ‘Š๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘Š

This program (with nested loops) display "Hello World!"

๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿคœ๐Ÿ‘‡๐Ÿ‘ˆ๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘‰๐Ÿค›๐Ÿ‘ˆ๐Ÿ‘Š๐Ÿ‘‰๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘‰๐Ÿ‘‡๐Ÿคœ๐Ÿ‘†๐Ÿค›๐Ÿ‘†๐Ÿ‘†๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘†๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿคœ๐Ÿ‘‰๐Ÿคœ๐Ÿ‘‡๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘ˆ๐Ÿ‘ˆ๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘‰๐Ÿค›๐Ÿ‘ˆ๐Ÿ‘ˆ๐Ÿค›๐Ÿ‘‰๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘Š๐Ÿ‘‰๐Ÿ‘‡๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘Š๐Ÿ‘Š๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘Š๐Ÿ‘‰๐Ÿ‘‡๐Ÿ‘Š๐Ÿ‘ˆ๐Ÿ‘ˆ๐Ÿ‘†๐Ÿคœ๐Ÿ‘‰๐Ÿคœ๐Ÿ‘†๐Ÿ‘‰๐Ÿ‘†๐Ÿค›๐Ÿ‘‰๐Ÿ‘‰๐Ÿค›๐Ÿ‘ˆ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘Š๐Ÿ‘‰๐Ÿ‘‰๐Ÿ‘Š๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†๐Ÿ‘Š๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘Š๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘Š๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘Š๐Ÿ‘‰๐Ÿ‘†๐Ÿ‘Š

Challenge

The file "input.hand" is the code of the program

Good luck!

hand-challenge's People

Contributors

jesus-seijas-sp 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.