Coder Social home page Coder Social logo

dudupopkhadze / jeka Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 0.0 3.57 MB

Jeka is a Dog-Robot, he can do complex stuff with combining basic instructions

Home Page: https://dudupopkhadze.github.io/jeka/

HTML 1.46% TypeScript 90.34% JavaScript 1.28% Less 6.92%
compiler educational-project interpreter language robot grammar-parser javascript parsing reactjs typescript

jeka's Introduction

Jeka

Jeka is project inspired by Karel.

Karel is an educational programming language for beginners, created by Richard E. Pattis in his book Karel The Robot: A Gentle Introduction to the Art of Programming.

android-chrome-512x512

What is Jeka

Jeka is friendly dog that lives in an environment consisting of a grid of streets (left-right) and avenues (up-down). Jeka understands basic instructions:

  • moveForward: Jeka moves by one square in the direction he is facing
  • turnLeft: Jeka turns 90 ° left
  • woof: Jeka barks at you (friendly)
  • frontIsClear: Jeka tells you if you can move forward in the facing direction
  • hasBones: Jeka tells you if there is a bone on the current position
  • putBone: Jeka puts a bone on the square he is standing at
  • pickBone: Jeka picks a bone from the square he is standing at

How does Jeka work?

Jeka has 4 main modules:

  • Mustang (custom language interpreter that takes the code you write and translates it to the commands known to Jeka)
  • BoardController (module that takes care of drawing Jeka, Jeka's World and Jeka's moves)
  • Engine (module that is responsible for connecting Mustang and BoardController
  • CodeController (module that takes care of getting user's input to the Engine)

Demo Code

Valid Jeka code example (success of running directly this code depends in the Jeka's World)

moveForward();
turnLeft();

fun turnRight(){
  turnLeft();
  turnLeft();
}

var i = 0;

while(i < 5){
  turnRight();
  i = i + 1;
}

while(frontIsClear()){
  moveForward();
}

while(hasBones()){
  pickBone();
}

putBone();

turnRight();

Running Locally

In the project directory, you can run:

npm start

Runs the app in the development mode on port: 3000.

npm run ts

Typescript check.

npm run build

Builds the app for production to the build folder.

jeka's People

Contributors

dudupopkhadze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jeka's Issues

putBone & pickBone

  • render bone svg
  • add bones location in board config
  • implement putBone
  • implement pickBone
  • implement boneExists

Dynamic Board Size

Right now board is hard-coded

  • make board size dynamic
  • UI for selecting board size

Add woof function to Jeka

Feature request:
It would be cool to have woof function which talks with browser web audio API for Jeka to bark.

Obstacles

Implement Karel-like obstacles

  • setup types/config for board obstacles
  • draw obstacles
  • integrate in engine

FrontIsClear

Implement frontIsClear();

  • return boolean depending on if jeka can move forward in the facing direction

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.