Giter Club home page Giter Club logo

programmer-games's Introduction

JetBrains team project

The project LearnElm_1:

2 buttons with + and -, changing the number N in between 3 and 12. On mouse click on screen a N-polygon is drawn with the center in click and random radius between 20 and 100. There are three squares user can click on to select one of predefined colors.

The project LearnElm_2 :

The same as LearnElm_1, but implemented with SVG (plus : main panel in the center, add stroke for figures)

The project Turing:

Implementation of Turing machine. Use function "runMachine" in Main.elm, give it machine and input word. It will print tape and final state for you.

Run the project 1:

Run the following commands in your terminal to download this project and start a server that compiles them for you:

git clone https://github.com/JetBrains/programmer-games.git 

cd programmer-games/LearnElm_1

elm-reactor

Now go to http://localhost:8000/, click src and then choose Main.elm file.

Run the project 2:

Run the following commands in your terminal to download this project and start a server that compiles them for you:

git clone https://github.com/JetBrains/programmer-games.git                 
                                                                                 
cd programmer-games/LearnElm_2_                                              

elm-reactor                                                                 

Now go to http://localhost:8000/, click src and then choose Main.elm file.

Run the project 3:

Run the following commands in your terminal to download this project and start a server that compiles them for you:

git clone https://github.com/JetBrains/programmer-games.git

cd programmer-games/Turing    

elm-reactor 

Now go to http://localhost:8000/, click src and then choose Main.elm file.

For running tests from Turing/test:

Run the following commands in your terminal:

git clone https://github.com/JetBrains/programmer-games.git

cd programmer-games/Turing

elm-make test/TestRunner.elm --output test.js

Agree to upgrade plan (install some packages)

node test.js

Then you will see the results of the tests running.


programmer-games's People

Contributors

mariyadavydova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

programmer-games's Issues

Provide debug button

In some cases user may want to click every step by himself. So when he clicks (in debug mode), he must not have opportunity to change trans table. And when he pressed Play button (in debug mode), machine should start from state, when debug stopped

Provide unit tests for the Turing Machine implementation from #2

At least the following cases should be tested:

  1. Add same item (_ _ 0 _ _ -> _ _ 0 0 _)
  2. Change item (_ _ 0 _ _ -> _ _ 1 _ _)
  3. Replace items (_ _ 0 1 _ -> _ _ 1 0 _)
  4. Change one last item (_ 0 0 0 _ -> _ 0 0 1 _)
  5. Change each second item (_ 0 0 0 0 _ -> _ 0 1 0 1 _)
  6. Replace all items with one item type (_ 1 2 3 _ -> _ 0 0 0 _)

Add initial position to machine config

We should have an opportunity to denote the initial position of TM head at the very beginning of its work (as an integer, where 0 means 'above the first element on a given part of tape').

Learn Elm

  1. Read http://www.elmbark.com/2016/03/16/mainstream-elm-user-focused-design
  2. Read http://guide.elm-lang.org/
  3. Create a small project.

The project:

Step 1.

  • 2 buttons with + and -, changing the number N in between 3 and 12.
  • On mouse click on screen a N-polygon should be drawn with the center in click and radius = 30.
  • The project should be standalone. README should explain how to run it locally.

Step 2.

  • Make radius random in between 20 and 40.

Step 3.

  • Add some variant of color picker (e.g. some squares user can click on to select one of predefined colors).

Make instructions more interactive

Too many text lines in the instructions and rules. Try to prepare some demo levels with special tips near main elements. User should click on first tip to go to the next tip and so on.

Implement `runStep` function

This function should take all the parameters that run takes + the state of the machine and return the updated state of the machine after one step.

Implement Turing Machine

The Turing Machine module is expected to be implemented with an ability to run a given machine on a given tape state.

Draw static image of Turing Machine

Add the following images:

  • Kitten (several colors)
  • Table
  • Basket
  • Ball (several colors)

Draw a TM as a table with baskets with balls and a kitten on some position.

Change processing of looking cat

User sees looking cat when he does not click Play button for a long time. But he want to see it when he does not click anywere for a long time. So process click on full game screen, not only on play button. And increase the time limit.

Provide blocks of levels

Make the following blocks:

  1. Head movement and addition balls at the end of input word
  2. Writing the sequence of balls on the tape
  3. Balls replacement in the input word ("in place")
  4. Characters analysis and comparison (by the transition to different states)
  5. Characters deletion and insertion (by word compression and extension)
  6. Result formation on the new place on the tape (as alternative of word modification "in place")
  7. Fix tape position by using helper characters
  8. Tasks with two variants of answer ?

Provide correct work of Demo Machine

Provide the following things when user push "Run" button:

  • cat should move to correct baskets, change colour according to machine`s states
  • balls should change colours and take place in correct way according to tape`s states

Also provide the following images :

  • mirror should show correct tape
  • transitional table should be correct

Make "save"

If the user closes game and comes back tomorrow, data should still be there.

var movedToStandalone = newFeature("movedToStandalone")
var movedToStandaloneFromCloud = newFeature("movedToStandalone")

Replace a function with a table in Turing Machine

Instead of taking a function denoting the actions based on current state and character, Turing runner should operate with a table of movements (most likely it should be a map or a map of maps).

(Kitten.Grey, Ball.Yellow) -> (Ball.Red, Kitten.Black, Move.Right)

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.