Skip to content

This is a C (99=<) frontend for the "Karel The Robot - Universal Backend" project.

License

Notifications You must be signed in to change notification settings

hendrikboeck/karel_the_robot_c_frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Karel The Robot - C Frontend

Codacy Badge C License GitHub release Maintenance

1. General

1.1. Abstract

Karel The Robot was invented in th 1970s by Richard E. Pattis at Standford Univeristy. Karel The Robot is a program, that should make the intruduction to coding for newcomers and beginners more simple. Its aim is to teach basic principles such as top-down programming and establish them from the beginning. Futhermore is learning programming with Karel The Robot a way more visual and rewarding experience then just printing out some strings and numbers onto the command-line.

Also see hendrikboeck/karel_the_robot_python3_backend.

1.2. How it works

The frontend connects to the PBE-pipe via a TCP-socket (tcp/14480). As a JSON-Writer and JSON-Reader the simplejson-c library is used. Currently StarterProjects for CLion and simple CMake projects are supported. StarterProjects can either be built from the repository (see 2. Create a Starter-Project) or downloaded from the Releases section.

2. Create a Starter-Project

You can create various StarterProjects for various Operating Systems through the Makefile.

make <target>

Values for <target>:

  • all: creates CMake and CLion Projects and creates them as dynamic and static.
  • cmake_static: creates a CMake Project, where all libraries are precompiled and staticly linked.
  • cmake_dynamic: creates a CMake Project, where all libraries and resources are downloaded and compiled in the build-process.
  • clion_static: creates a CLion Project, where all libraries are precompiled and staticly linked.
  • clion_dynamic: creates a CLion Project, where all libraries and resources are downloaded and compiled in the build-process.

3. Example Program

The header-file karel.h can be found at res/karel.h.

#include "karel.h"

void turnRight();
void moveToWall();

int main(void) {
  loadWorld("LivingRoom");

  moveToWall();
  turnLeft();
  move();
  turnRight();
  ...

  return 0;
}

void turnRight() {
  turnLeft();
  turnLeft();
  turnLeft();
}

void moveToWall() {
  while(frontIsClear())
    move();
}

4. Acknowledgements

About

This is a C (99=<) frontend for the "Karel The Robot - Universal Backend" project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published