RUR-PLE

Presentazione ufficiale

Simply put, RUR-PLE is a Python Learning Environment.
With the assistance of a robot named Reeborg, one can explore the fun of programming in the Python language.
A standard Python interpreter is also included as well as an editor with a special “instant run” feature.


L’IDE di RUR-PLE integra 4 schede

  1. RUR: Read and Learn – Tutorial
  2. Robot: Code and Learn – L’ambiente di sviluppo
  3. Python: Code and Learn – La shell Python
  4. Python: simple editor

RUR-ide-2


RUR: Read and Learn – Tutorial


La documentazione ufficiale può essere consultata all’interno dell’ambiente oppure, più agevolmente, con il browser

C:\Program Files (x86)\RUR-PLE\lessons\en

Contenuto

  • About RUR-PLE
  • Acknowledgements
  • Summary of instructions
  • Lessons

RUR-ide-1


SUMMARY OF INSTRUCTIONS


Azioni

  1. move() – fa un passo in avanti
  2. pick_beeper() – raccoglie il sonaglio
  3. put_beeper() – rilascia il sonaglio
  4. turn_left() – gira a sinistra
  5. turn_off() – spegne il robot

Controlli

  1. carries_beepers() – trasporta sonagli?
  2. facing_north() – guarda a nord?
  3. front_is_clear() – davanti è libero?
  4. left_is_clear() – a sinistra è libero?
  5. next_to_a_beeper() – vicino a un sonaglio?
  6. on_beeper() – su un sonaglio?
  7. right_is_clear() – a destra è libero?

Funzioni speciali

  1. repeat(function, number_of_times)
  2. for number in range(number_of_times):
    function()

Programmazione OOP

  1. Reeborg=UsedRobot()
  2. Reeborg.carries_beepers()
  3. Reeborg.facing_north()
  4. Reeborg.front_is_clear()
  5. Reeborg.left_is_clear()
  6. Reeborg.move()
  7. Reeborg.next_to_a_beeper()
  8. Reeborg.on_beeper()
  9. Reeborg.pick_beeper()
  10. Reeborg.put_beeper()
  11. Reeborg.right_is_clear()
  12. Reeborg.turn_left()

Opzioni avanzate

  1. set_trace_style(style=1, colour=’sea green’)
    1. Any colour name recognized by wxPython is acceptable
    2. style is one of [1, 2, 3, 4, 5] set_delay(time)
    3. 0 < time < 10 (in seconds)
  2. Reeborg=UsedRobot(avenues=1, streets=1, orient_key=’E’, beepers=0, name=’robot’, colour=’grey’)
    1. orient_key is one of ‘E’ or ‘e’, ‘W’ or ‘w’, ‘S’ or ‘s’, ‘N’ or ‘n’.
    2. Available robot colours are: ‘yellow’, ‘blue’, ‘light blue’, ‘purple’ and ‘green’.
    3. Any other colour will result in the default (‘grey’) to be used.
    4. Note that a “serial number” may be appended to the robot’s “name”, so that each robot during an entire play/work session with rur-ple will have a unique name.
  3. Reeborg.set_trace_style(style=1, colour=’sea green’)
  4. Reeborg.set_delay(time)

Nuovo robot migliorato

  1. Guido=RefurbishedRobot() – inherits from UsedRobot
  2. Guido.turn_right()
  3. Guido.facing_east()
  4. Guido.facing_south()
  5. Guido.facing_west()
  6. Guido.roll_dice(n=6) – random integer between 1 and n

LESSONS


  1. Il robot si presenta nell’angolo in basso a sinistra rivolto a EST
    RUR-ide-2
  2. Se attivato con il mouse risponde ai comandi
    1. freccia sinistra, si gira di 90° in senso antiorario
    2. freccia su, avanza di un passo
  3. Se provi a superare la cornice esistente appare la finestra di errore
    Error
  4. I comandi sono in inglese e seguiti da ()
  5. Il programma minimo deve contenere il comando turn_off() (per spegnere il robot…)
    turn_off()
  6. Con move() avanza avanti di un passo

    move()
    turn_off()
  7. Due passi
    move()
    move()
    turn_off()
  8. Il maiuscolo è diverso dal minuscolo e provoca un errore!

    Move()
    turn_off()
  9. I commenti iniziano con #

    # Il mio primo programma
    move()
    move()
    turn_off()
  10. Si possono creare degli alias per i comandi

    avanti = move
    
    avanti()
    turn_off()
  11. Con turn_left() gira a destra
    turn_left_end

    move()
    turn_left()
    move()
    turn_off()
  12. Disegna un quadrato

    move()
    turn_left()
    move()
    turn_left()
    move()
    turn_left()
    move()
    turn_left()
    turn_off()
  13. Disegna un quadrato con lato doppio
    left_square2

    move()
    move()
    turn_left()
    move()
    move()
    turn_left()
    move()
    move()
    turn_left()
    move()
    move()
    turn_left()
    turn_off()
  14. Disegna un quadrato girando in senso orario
    square2right

    turn_left()
    move()
    move()
    turn_left()
    turn_left()
    turn_left()
    move()
    move()
    turn_left()
    turn_left()
    turn_left()
    move()
    move()
    turn_left()
    turn_left()
    turn_left()
    move()
    move()
    turn_left()
    turn_left()
    turn_off()
  15. Sposta il robot (con la tastiera) e scrivi il programma per compiere il percorso di ritorno
    back_home_start back_home

    move()
    turn_left()
    turn_left()
    turn_left()
    move()
    turn_left()
    turn_left()
    turn_left()
    move()
    turn_left()
    move()
    turn_left()
    move()
    move()
    move()
    turn_left()
    turn_off()
  16. Da … a …
    beeper1 beeper2

    move()
    move()
    pick_beeper()
    move()
    move()
    turn_left()
    move()
    move()
    put_beeper()
    move()
    turn_off()
  17. move()
    move()
    pick_beeper()
    pick_beeper()
    pick_beeper()
    pick_beeper()
    pick_beeper()
    move()
    put_beeper()
    put_beeper()
    put_beeper()
    put_beeper()
    put_beeper()
    move()
    turn_off()
  18. Con il pulsante wall appare la griglia e con il mouse si possono aggiungere/eliminare pareti
    buildwalls wall1img
    Premendo di nuovo il pulsante wall la griglia scompare ma le pareti rimangono.
  19. Da … a …
    loopstart loopend

    move()
    move()
    move()
    move()
    turn_left()
    move()
    move()
    turn_left()
    move()
    move()
    turn_left()
    move()
    move()
    move()
    move()
    turn_off()
  20. Consegna del giornale
    newspaper_start newspaper_end
  21. Saltare gli ostacoli
    hurdles1_start hurdles1_end
  22. Tempo di raccolta
    harvest1
  23. Uscire dal labirinto
    maze1_start maze1_end
  24. Tre volte a sinistra equivale a destra
    square2right

  25. back_up

  26. jump1start jump1end

  27. harvest2

  28. move_pick_startmove_pick_end

  29. harvest3

  30. if1start if1end

  31. if2start if2end

  32. left_square2

  33. around2

  34. around3
  35. 3+2=5
    add3_2_start add3_2_end
  36. 8+4=12
    add8_4_start add8_4_end


Robot: Code and Learn – L’ambiente di sviluppo


L’ambiente di sviluppo

RUR-ide-2

La barra degli strumenti

  1. btn_open_program Carica un programma
  2. btn_save_program Salva il programma
  3. btn_open_world Carico uno scenario
  4. btn_save_world Salvo lo scenario
  5. btn_reset_world Reimposta lo scenario
  6. btn_run Esegue il codice
  7. btn_step Esegue passo-passo
  8. btn_pause Pausa
  9. btn_stop Stop
  10. btn_speed Velocità del robot
  11. btn_walls Griglia (Sì/ No)
  12. btn_resize_world Pannello: dimensioni dello scenario
  13. btn_beepers Pannello: numero di sonagli
  14. btn_add_robot Robot (Sì/ No)
  15. btn_show_world_file Pannello: codice dello scenario (Sì/ No)
  16. new_images Carica 4 immagini per il robot
    blue_robot_n blue_robot_s blue_robot_w blue_robot_e green_robot_n green_robot_s green_robot_w green_robot_e light_blue_robot_e light_blue_robot_n light_blue_robot_s light_blue_robot_w purple_robot_n purple_robot_s purple_robot_w purple_robot_e robot_e robot_n robot_s robot_w yellow_robot_e yellow_robot_n yellow_robot_s yellow_robot_w

Python: Code and Learn – La shell Python


La shell Python 2.5.2…

RUR-ide-3

Il progetto è aggiornato fino al 2008 perché l’autore è passato allo sviluppo della versione online.


Python: simple editor


RUR-ide-4Un editor molto semplice, con pochi strumenti

  1. open_py Open Python file
  2. save_py Save Python file
  3. run1 Run Python file
  4. run_with Run Program with argument list
  5. help Help
  6. goto Go to line number
  7. show_hide Hide or show output window
  8. layout Change layout
  9. clear_text Clear text



RISORSE ONLINE

  1. Ghitub: rur-ple
  2. Sourgeforge
    1. Learning Python: Child’s Play with RUR-PLE!
    2. RUR: a Python Learning Environment
  3. Google Code: rur-ple
  4. Wikipedia: RUR-PLE
  5. Reeborg’s world (nuova versione online)