Coder Social home page Coder Social logo

sgimenez / laby Goto Github PK

View Code? Open in Web Editor NEW
98.0 98.0 39.0 859 KB

Learn programming, playing with ants and spider webs ;-)

Home Page: https://sgimenez.github.io/laby/

License: Other

Makefile 0.65% Shell 2.88% C 1.50% C++ 1.04% Java 1.40% JavaScript 0.87% Lua 0.75% OCaml 83.64% Pascal 1.16% Perl 0.79% Prolog 0.37% Python 0.69% Ruby 0.70% Scheme 0.82% Vala 0.80% PHP 1.01% Go 0.93%

laby's People

Contributors

alienhunter3010 avatar amitamely avatar antiochus avatar aripm avatar dahu avatar dashohoxha avatar devhammed avatar glixx avatar janneke avatar kadkarol avatar kimsey0 avatar malo-denielou avatar sandrobonazzola avatar sgimenez avatar suxiaojack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laby's Issues

Ruby look function is not working

The look function in Ruby is not working. In Python I can get a laby_name like 'wall' as an integer, in Ruby there is no access to the look results. Or I am unable to use it somehow.

How can I add more levels. Do I need to incorporate message for all languages in each added level?

Thanks a lot for a great program. I was able to compile it in my Ubuntu(ocelot) with no problems.

How to manage standard input and output?

I'm involved in a school project for teaching Python in an high school, we adopted Laby and I think it's just awesome! Thanks for developing it!
Anyhow, we was wondering if there is a way to print standard output in the message box and/or to wait for user's input with python "input" function. This would allow us to adopt Laby alone as a complete IDE for the very first programs.
Thanks!

Use proper per-file GPL headers

While reviewing the Fedora package, the automatic tool which check for license compliance detected:
Checking patched sources after %prep for licenses. Licenses
found: "GPL", "LGPL (v2 or later)", "GPL (v3 or later)", "Unknown or
generated". 97 files have unknown license.
Please add proper per-file GPL headers to ensure they're released under the right license.

Help not showing up on Ubuntu 17.04

Configuration: laby 0.6.4-1 installed by apt on Unbuntu 17.04, running under Unity, french.

Symptom: the help box is empty. One can see the usual "Aide" title on the lower left of the window, but there is no text box below. It seems to be independent off the programming language or window size.

mods problem

Hello,
In ubuntu 20.04, in vm ware, I can't choose another language than perl.
I installed gcc and now c is proposed, but Python 2 et 3 are already installed but not working
Laby version : 0.6.4-3

Version for Fedora and other characteristics

I like this game since we always know linux play him, I am currently using Fedora version and have not found him. I will try to make a version of the code here to run it.

But if you have anything please tell me. : D

How to use "if" instructions

Hello
I don't know how to use the conditions when I need to use "if" in level "3a",could you tell me the answer?

empty sound files installed

While reviewing the fedora package, the automated tool detected:
laby.x86_64: E: zero-length /usr/share/laby/sound/carry-exit.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/drop-no-space.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/drop-nothing.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/exit-in.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/no-exit.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/rock-in.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/rock-take.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/start.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/take-no-space.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/take-nothing.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/wall-in.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/web-in.wav
laby.x86_64: E: zero-length /usr/share/laby/sound/web-out.wav

Please add sound files or drop the installation of the empty files.

Users need a way to learn syntax

User NEED a way to learn the syntax of the language and the specific funcions of the program, otherways it will be useless for it's goals: teach people to program.

I know C but I had a lot of trouble to find ou that I was supposed to use the function look() in 2a.laby, which in my case was translated to my system's default language, which I needed to guess what it was.

But later I got stuck again helpless. Please, place useful hints on the levels and guide the user to learn how to get through the software.

Thanks

Please port the code to use getaddrinfo().

While trying to port laby to OpenSuse, automated check detects:
laby.x86_64: I: binary-or-shlib-calls-gethostbyname /usr/bin/laby
The binary calls gethostbyname(). Please port the code to use getaddrinfo().

See https://en.opensuse.org/openSUSE:Packaging_checks#binary-or-shlib-calls-gethostbyname
and http://udrepper.livejournal.com/16116.html about why this is raised.

OpenSuse Tumbleweed build is available on https://build.opensuse.org/package/show/home:sandrobonazzola/laby

Missing png resources

Running laby installed from sources yields:

[fatal error] cannot find resource "tiles/ant-w.png"

The corresponding .svg file is found however (according to laby --debug), but gdk cannot load it:

GdkPixbufError: Couldn't recognize the image file format for file '/[…]/tiles/ant-w.svg'

Thanks!

laby as web application

We are teaching an introductory programming class, in C++ at Université Paris Sud. We have been using for years "laby" in our first computer lab, and it's always proven very effective in engaging students and exposing them with the first constructs that they will learn in detail over the following weeks (if, for, functions, ...). We are also using it for the fête de la science at LRI. Thanks so much!

One thing has been bothering us though: students and participants would go out of the lab with a strong desire to play further at home, but then be stuck with the installation barrier. To resolve this, we would want to have laby available online as a web application.

Manpower permitting, we are considering reimplementing laby, reusing as much as possible of the existent (data, translations, artwork, ...). In term of technology we are planning to use the Jupyter interactive computing environment; in practice, each level would be a jupyter notebook, which would include explanations, a graphical widget (implemented using Jupyter widgets, and their c++ bindings
and plots) displaying the labyrinth together with execution controls, and an input box for the user to enter her program.

Rationale for this technology stack:

  • We are already using Jupyter in our computer labs, with the cling C++ interpreter. So our students will learn right away the environment they will use later on.
  • This can be easily deployed for local use (in the computer lab), in our JupyterHub server (from home), or on a public server (e.g. binder ).
  • Jupyter is inherently multi-language; so even if we will focus on C++, generalizing to other languages should not take too much efforts. Ideally just by linking to a small C++ library defining and controlling the widget.
  • The student will keep a trace of the program they wrote for each labyrinth, for later reference or discussion with the teacher.
  • Jupyter supports syntax highlighting, introspection, online documentation, ...
  • Teachers can easily customize the notebooks to their taste, e.g. for integration in a larger body of notebooks.
  • If desired, it should be possible to connect this to nbgrader for autograding.

What do you think?

cc: @JoelGay

Add translation for the enum type ("Tile")

In Vala (and C# and possible others) you have to prepend the enum type name when you use an enum value:

while (laby_name_look () == Tile.laby_name_Void) {
   ...
 }

If that is translated to another language the "Tile" will be left in English.

keep it up!

Hello,
I found Qimo. I had my now 11 year old testing it, she found Laby, she asked me what it was, got her through a level and before I knew it she had completed several levels. She wrote each step manually, she dose not know about functions (yet). Anyway I really like the program and would love to beta test or what ever I can do to help.
I am far behind on my programming skills, but I do understand it as I did write in the 80's, and do know html 4, java, xml and such.
First I need to learn to make a build on Fedora.

Please keep up the project.
Thanks

[Patch] Translations for GenericName

This patch was generated using translations from Ubuntu for "realtimebattle".

diff -ur laby.orig/packaging/laby.desktop laby/packaging/laby.desktop
--- laby.orig/packaging/laby.desktop    2015-08-31 12:03:34.000000000 +0300
+++ laby/packaging/laby.desktop 2015-08-31 12:44:14.000000000 +0300
@@ -1,6 +1,26 @@
 [Desktop Entry]
 Name=Laby
 GenericName=Programming Game
+GenericName[bs]=Igra programiranja
+GenericName[pt_BR]=Jogo de programação
+GenericName[ca]=Joc de programació
+GenericName[da]=Programmering spil
+GenericName[fr]=Jeu de programmation
+GenericName[gl]=Xogo de programación
+GenericName[de]=Programmierspiel
+GenericName[el]=Προγραμματιστικό παιχνίδι
+GenericName[it]=Gioco di programmazione
+GenericName[ms]=Permainan pengaturcaraan
+GenericName[pl]=Gra w programowanie
+GenericName[pt]=Jogo de programação
+GenericName[ru]=Игра в программирование
+GenericName[sl]=Igra programiranja
+GenericName[es]=Juego de programación
+GenericName[sv]=Programmeringsspel
+GenericName[tr]=Oyun programlama
+GenericName[uk]=Гра у програмування
+GenericName[cs]=Programovací hra
+GenericName[ja]=プログラミングゲーム
 Exec=laby
 Icon=laby
 Terminal=false

laby fails to build due to unsafe string

On Fedora Rawhide laby fails to build with:

  • /usr/bin/ocamlc.opt -c -I /usr/lib64/ocaml/lablgtk2 -g -I src/dtools -I src -o src/dtools/conf.cmi src/dtools/conf.mli
    File "src/dtools/conf.mli", line 1:
    Error: Invalid import of F, compiled with -unsafe-string.
    This compiler has been configured in strict safe-string mode (-force-safe-string)
    Command exited with code 2.
    make: *** [Makefile:20: native] Error 1

the compiler there doesn't allow unsafe strings.

Building on Ubuntu: "Unbound module GSourceView2"

I'm trying to build from source on Ubuntu 14.04.
I've installed the following Ubuntu packages:

  • ocaml
  • ocaml-findlib
  • liblablgtk2-ocaml
  • liblablgtk2-ocaml-dev

But I get this error when building:

$ make
Building laby-0.6.4 for linux-amd64
+ /usr/bin/ocamlopt -c -I /usr/lib/ocaml/lablgtk2 -g -I src -I src/dtools -o src/gfx.cmx src/gfx.ml
File "src/gfx.ml", line 79, characters 17-41:
Error: Unbound module GSourceView2
Command exited with code 2.
Compilation unsuccessful after building 81 targets (0 cached) in 00:00:02.
make: *** [all] Erreur 1

How can I get GSourceView2?

[Patch] Update desktop file

GenericName=Laby - labyrinth game
GenericName[ru]=Laby - игра-лабиринт
Comment=Learn how to program with ants and spider webs
Comment[fr]=Apprenez à programmer avec des fourmis et des toiles d'araignées
Comment[af]=Leer om te programmeer met miere en spinnerakke
Comment[sq]=Mësoni si të programoni me milingona dhe rrjeta merimange
Comment[ast]=Deprendi a programar con formigues y redes de arañes
Comment[bn]=শিখুন কিভাবে এন্ট এবং স্পাইডার ওয়েবের সঙ্গে প্রোগ্রাম
Comment[bs]=Naučite se kako programirati pomoću mrava i paukovih mreža
Comment[bg]=Научете се да програмирате с мравки и паяжини
Comment[ca]=Apreneu a programar amb formigues i teles d'aranya
Comment[ca@valencia]=Apreneu a programar amb formigues i teles d'aranya
Comment[pt_BR]=Aprenda a programar com formigas e teias de aranha
Comment[crh]=Karıncalar ve örümcek ağları ile programlamayı öğrenin
Comment[zh_TW]=學習如何用 ants 和 spider webs 寫程式
Comment[zh_CN]=了解如何使用蚂蚁和蜘蛛网进行编程
Comment[cs]=Naučte se programovat s pomocí mravenců a pavučin
Comment[da]=Lær at programmere med myrer og spindelvæv
Comment[nl]=Leren programmeren met mieren en spinnenwebben
Comment[fi]=Opettele ohjelmoimaan muurahaisilla ja hämähäkkien verkoilla
Comment[gl]=Aprenda a programar con formigas e arañeiras
Comment[el]=Μάθετε προγραμματισμό με μυρμηγκάκια και ιστούς αράχνης
Comment[de]=Lernen Sie Programmieren, mit Ameisen und Spinnennetzen
Comment[hu]=Tanulj programozni hangyákkal és pókhálókkal
Comment[it]=Imparare a programmare con ant e spider web
Comment[ja]=クモの巣を避けるアリプログラムを作ろう
Comment[ky]=Кумурскалардын жана жөргөмүштөрдун желелерин үлгү кылып программалоого үйрөтүү
Comment[ms]=Pelajari bagaimana lakukan pengaturcaraan
Comment[nb]=Lær å programmere med maur og edderkoppnett
Comment[oc]=Aprene a programar amb de formigas e de telaranhas
Comment[pl]=Nauka programowania z udziałem mrówek i pajęczyn
Comment[pt]=Aprende a programar com as formigas e as teias de aranha
Comment[ro]=Învățați programare cu furnici și păianjeni virtuali
Comment[ru]=Обучение программированию на примере муравьёв и паучьих сетей
Comment[sl]=Naučite se programiranja s pomočjo mravelj in pajkovih mrež
Comment[es]=Aprende a programar con hormigas y redes de arañas
Comment[sv]=Lär dig att programmera med myror och spindelnät
Comment[vi]=Học cách để lập trình với kiến và mạng nhện
Comment[tr]=Karıncalar ve örümcek ağları ile programlamayı öğrenin
Comment[uk]=Навчання програмуванню на прикладі мурашок та павукових мереж
Comment[es_MX]=Aprenda a programar con hormigas y telarañas
Comment[hy]=Ինչպես ծրագրավորել մրջունների և սարդերի ցանցերի միջոցով
Comment[id]=Belajar memprogram dengan ants dan spider web
Comment[lv]=Iemācīties programmēt ar skudru un zirnekli
Comment[sr]=Научите како да се програм са мравима и паука Вебс
Comment[th]=เรียนรู้วิธีการเขียนโปรแกรมที่มีมดและใยแมงมุม

Needs port to lablgtk3

gtksourceview2 is deprecated and has been unmaintained for a long time (at least 3.5 years). It will soon be removed from Debian. Meanwhile, lablgtk3 has been released, with bindings to gtksourceview3. IMHO, it's time to port laby to lablgtk3.

Can't locate robot.pl

Hey, I know this is an old project, but I tried to install it on a ZorinOS 16 (Ubuntu 20.04) machine via

sudo apt-get install laby

and I get an error

Can't locate robot.pl...

when running the code... the program itself seems to work.

Any hints or at least links to similar programs (simple left right commands and labyrinth or stuff for children) working on ubuntu?

Thank you very much.

How to build project for windows under linux?

I'm working under linux,but I try to build your project for windows.
Is this possible?
I have downloaded mingw-w64 and mingw-ocaml etc. under linux,but I don't know how to use to complie your project.
I can only do is using your ./build program to build linux target laby,and I got it.(auto-apt run ./build)
Please help me,Thanks!

Add pascal language mod

Many russian scools learns pascal with free pascal compiler.
Well, I created pascal mod, that uses fpc.
How can I contribute or share this?
Also some russian translation should be fixed.
Thanks.

Ideas for improvement

Loved your game! Great work!

I think that it is a nice challenge for advanced programmers, not only for kids and beginners.

I challenged myself to write a complete algorithm for fully automated ant, which is capable of finding the exit without prior knowledge of what the maze looks like, and that gave me some fine challenge for a couple of days:
figuring out how to navigate the short sighted ant which is only capable of looking 1 tile ahead at a time, mapping its surrounding, navigating around without going in circles.

To challenge my algorithm, I built some advanced levels.

I added them to the Wiki page, and also added a simple English guide for Java (more or less like the German C guide). I hope that I didn't make any serious mistakes in the French and Spanish text translations - I used Google Translate, so I can't tell for sure.

Question:

I noticed that dropping a rock on top of rubble was forbidden, however there's no way to tell that the tile is occupied by rubble other than trying to drop rock on top of it and failing.
Is this a bug, or is this a deliberate complication to challenge the advanced programmers playing the game?

Bug: (fixed in d850fa0)

The error message which is displayed when trying to take a rock while already carrying a rock is incorrect - it says that there's no rock to take instead of saying that only one rock can be carried at a time.

Simple enhancement suggestions:
  1. Have the methods drop(), take(), forward(), and escape() return a boolean value, giving an indication to whether the action was successful or not.
  2. Do not cache map list and the maps themselves - they are small files anyway. I was required to restart laby anytime I made a change to my test maps, and when adding new maps.
Advanced enhancements (may I should challenge myself on these ones :) ):
  1. Energy
    • Robot ant has a property of energy, whose initial value is defined in the map file.
    • Each forward move reduced 1 energy point.
    • Moving around carrying a rock reduce 5 energy points.
    • A new Tile type is introduced: Grain
    • A new method is introduced: boolean eat();
    • If a grain is located in the tile in front of the ant, it will eat it and energy will raise by 20 points and the return value is true.
    • If no grain is located in the tile in front, error message will be displayed in the console and the return value is false.
    • When there's not enough energy to move forward, forward() will return false and an error message will be displayed in the console.
  2. Support random walls (like web and rock), using capital O in the map.

Again, great job! Well done!

I can help

hi,

I really like this program and I would like to help a little. I can write an help that is easier to understand that the texts file with all the translation.
Don't hesitate to contact me if you're interessed.

Regards

Build failure in Fedora 28 mass rebuild

Rebuilding laby on Fedora 28 fails with:

  • /usr/bin/ocamlopt.opt -c -I /usr/lib64/ocaml/lablgtk2 -g -I src -I src/dtools -o src/mod.cmx src/mod.ml
    File "src/mod.ml", line 97, characters 13-26:
    Warning 3: deprecated: String.create
    Use Bytes.create instead.
    File "src/mod.ml", line 101, characters 23-29:
    Error: This expression has type bytes but an expression was expected of type
    string
    Command exited with code 2.
    make: *** [Makefile:20: native] Error 1

ocamlfind: Package `lablgtk2' not found

Hello,
I am not an expert by any means, I have installed ocaml.
When I try to make I get an error...

ocamlfind: Package `lablgtk2' not found

Searched for this and others have the same error but no one seem to have any resolve. did see "ocamlfind is in aur/ocaml-findlib, which is UNSUPPORTED"
then something about deploying meta file from source..

well now I am lost. Can you help?
also I am on Fedora Core 18 w/ gnome 3.6 desktop

Thank You
Jay

I try to build this in my computer but there is a error

q@ubuntu:~/github/laby$ ./build
Building laby-0.6.4 for linux-amd64

  • /usr/bin/ocamlopt -c -I /usr/lib/ocaml/lablgtk2 -g -I src -I src/dtools -o src/gfx.cmx src/gfx.ml
    File "src/gfx.ml", line 79, characters 17-41:
    Error: Unbound module GSourceView2
    Command exited with code 2.
    Compilation unsuccessful after building 81 targets (80 cached) in 00:00:00.

I like this game and wan't to translate it into Chinese. Would you please help me to see where is wrong? Thanks a lot.

Add non English translations

I am able to provide a icelandic translation for the software if I am given the proper text encoding to use.
If the maintainers are interested of course.

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.