Laby Game linux

This article has been written before more than 24months, information might old.

Am vazut zilele trecute in repostory un joc numit laby , citindu-i descrierea am aflat ca este un joc educativ , mai exact gameplay-ul consta in scrierea uni pseudo cod intr-o sintaxa a unui limbaj de programare cunoscut la alegere dintre ( c , java , python ) pentru ca o furnica sa navigheze corect catre iesirea dintr-un nivel .

In general procedurile si caracteristicile standard c / java / etc nu sunt aplicabile decat intr-o maniera limitata , mai concret lipeste abilitatea de a declara variabile sau de a folosi anumiti operatori logici cat si multe cuvinte cheie existente in mod normal .

Chiar si in aceste conditii este destul de interesant cu toate ca nivele sunt probabil facute pentru oameni care nu au programat in viata lor ( extraordinar de simple ) si foarte putine rezolvarea tuturor nivelelor nu necesita mai mult de 10 minute , plus de asta odata scrise sub o sintaxa nici nu mai are rost sa le scrii sub alta sintaxa pentru ca sunt aproape identice .

Nivel 1a.Laby

#include "robot.h"

void ant()
{
while(look() != Exit ){
while(look() != Wall) forward();
right();
while(look() != Wall) forward();
left();
}escape();
}

Nivel 2a.Laby

#include "robot.h"

void ant()
{
forward();right();forward();
take();left();drop();right();
forward();forward();forward();
left();forward();right();escape();
}

Nivel 1a.Laby

#include "robot.h"

void ant()
{
forward();right();forward();
take();left();drop();right();
forward();forward();forward();
left();forward();right();escape();
}

Nivel 1c.Laby

#include "robot.h"

void ant()
{
forward();forward();
take();left();left();drop();
right();right();forward();
forward();forward();escape();
}

Nivel 2a.Laby

#include "robot.h"

void ant()
{
while (look() != Exit) forward();
escape();
}

Nivel 2b.Laby

#include "robot.h"

void ant()
{
forward();
while (look() == Rock){
take();left();left();
drop();left();left();
forward();
}forward(); 
escape();
}

Nivel 2c.Laby

#include "robot.h"

void fl(){
while(look() == Void ) forward();
if(look() != Exit) left();
}

void fr(){
while(look() == Void ) forward();
if(look() != Exit) right();
}

void ant()
{
while(look() != Exit)
{
fl();fl();fr();fr();
}escape();
}

Nivel 3a.Laby

#include "robot.h"

void ant()
{
left();forward();right();
if (look() == Web) {
right();forward();forward();left();
forward();forward();left();forward();
right();escape();
}
else {
forward();forward();right();forward();
left();escape();
}}

Nivel 3b.Laby

#include "robot.h"

void gotocoridor(){
  while(look() == Void) forward();
  if(look() == Rock){
  take();left();left();
  drop();left();left();
  while(look() == Void) forward();
  }
}

void ant()
{
  right();forward();left();
  if(look() == Web){
  left();forward();forward();right();
  gotocoridor();
  right();forward();left();escape();
  }else{
  gotocoridor();
  left();forward();right();escape();
  }
}

Nivel 4a.Laby

#include "robot.h"

void ant()
{while(look() != Exit){
if(look() == Void) forward();
else left();
}escape();}

Nivel 4a.Laby

#include "robot.h"

void FWeb(){
while(look() == Void) forward();
if(look() == Web){
left();left();forward();
forward();left();forward();
forward();left();
}}

void ant()
{
forward();left();
while(look() != Wall) FWeb();
right();
while(look() != Exit) forward();
escape();
}

Acestea sunt toate nivele momentan .

Share the joy

Leave a Reply