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
- RUR: Read and Learn – Tutorial
- Robot: Code and Learn – L’ambiente di sviluppo
- Python: Code and Learn – La shell Python
- Python: simple editor
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
SUMMARY OF INSTRUCTIONS
Azioni
- move() – fa un passo in avanti
- pick_beeper() – raccoglie il sonaglio
- put_beeper() – rilascia il sonaglio
- turn_left() – gira a sinistra
- turn_off() – spegne il robot
Controlli
- carries_beepers() – trasporta sonagli?
- facing_north() – guarda a nord?
- front_is_clear() – davanti è libero?
- left_is_clear() – a sinistra è libero?
- next_to_a_beeper() – vicino a un sonaglio?
- on_beeper() – su un sonaglio?
- right_is_clear() – a destra è libero?
Funzioni speciali
- repeat(function, number_of_times)
- for number in range(number_of_times):
function()
Programmazione OOP
- Reeborg=UsedRobot()
- Reeborg.carries_beepers()
- Reeborg.facing_north()
- Reeborg.front_is_clear()
- Reeborg.left_is_clear()
- Reeborg.move()
- Reeborg.next_to_a_beeper()
- Reeborg.on_beeper()
- Reeborg.pick_beeper()
- Reeborg.put_beeper()
- Reeborg.right_is_clear()
- Reeborg.turn_left()
Opzioni avanzate
- set_trace_style(style=1, colour=’sea green’)
- Any colour name recognized by wxPython is acceptable
- style is one of [1, 2, 3, 4, 5] set_delay(time)
- 0 < time < 10 (in seconds)
- Reeborg=UsedRobot(avenues=1, streets=1, orient_key=’E’, beepers=0, name=’robot’, colour=’grey’)
- orient_key is one of ‘E’ or ‘e’, ‘W’ or ‘w’, ‘S’ or ‘s’, ‘N’ or ‘n’.
- Available robot colours are: ‘yellow’, ‘blue’, ‘light blue’, ‘purple’ and ‘green’.
- Any other colour will result in the default (‘grey’) to be used.
- 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.
- Reeborg.set_trace_style(style=1, colour=’sea green’)
- Reeborg.set_delay(time)
Nuovo robot migliorato
- Guido=RefurbishedRobot() – inherits from UsedRobot
- Guido.turn_right()
- Guido.facing_east()
- Guido.facing_south()
- Guido.facing_west()
- Guido.roll_dice(n=6) – random integer between 1 and n
LESSONS
- Il robot si presenta nell’angolo in basso a sinistra rivolto a EST
- Se attivato con il mouse risponde ai comandi
- freccia sinistra, si gira di 90° in senso antiorario
- freccia su, avanza di un passo
- Se provi a superare la cornice esistente appare la finestra di errore
- I comandi sono in inglese e seguiti da ()
- Il programma minimo deve contenere il comando turn_off() (per spegnere il robot…)
turn_off()
- Con move() avanza avanti di un passo
move() turn_off()
- Due passi
move() move() turn_off()
- Il maiuscolo è diverso dal minuscolo e provoca un errore!
Move() turn_off()
- I commenti iniziano con #
# Il mio primo programma move() move() turn_off()
- Si possono creare degli alias per i comandi
avanti = move avanti() turn_off()
- Con turn_left() gira a destra
move() turn_left() move() turn_off()
- Disegna un quadrato
move() turn_left() move() turn_left() move() turn_left() move() turn_left() turn_off()
- Disegna un quadrato con lato doppio
move() move() turn_left() move() move() turn_left() move() move() turn_left() move() move() turn_left() turn_off()
- …
- Disegna un quadrato girando in senso orario
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()
- Sposta il robot (con la tastiera) e scrivi il programma per compiere il percorso di ritorno
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()
- …
- Da … a …
move() move() pick_beeper() move() move() turn_left() move() move() put_beeper() move() turn_off()
- …
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()
- Con il pulsante
appare la griglia e con il mouse si possono aggiungere/eliminare pareti
Premendo di nuovo il pulsantela griglia scompare ma le pareti rimangono.
- Da … a …
move() move() move() move() turn_left() move() move() turn_left() move() move() turn_left() move() move() move() move() turn_off()
- Consegna del giornale
- Saltare gli ostacoli
- Tempo di raccolta
- Uscire dal labirinto
- Tre volte a sinistra equivale a destra
- …
- …
- …
- …
- …
- …
- …
- …
- …
- …
- 3+2=5
- 8+4=12
- …
Robot: Code and Learn – L’ambiente di sviluppo
L’ambiente di sviluppo
La barra degli strumenti
Carica un programma
Salva il programma
Carico uno scenario
Salvo lo scenario
Reimposta lo scenario
Esegue il codice
Esegue passo-passo
Pausa
Stop
Velocità del robot
Griglia (Sì/ No)
Pannello: dimensioni dello scenario
Pannello: numero di sonagli
Robot (Sì/ No)
Pannello: codice dello scenario (Sì/ No)
Carica 4 immagini per il robot
Python: Code and Learn – La shell Python
La shell Python 2.5.2…
Il progetto è aggiornato fino al 2008 perché l’autore è passato allo sviluppo della versione online.
Python: simple editor
Un editor molto semplice, con pochi strumenti
Open Python file
Save Python file
Run Python file
Run Program with argument list
Help
Go to line number
Hide or show output window
Change layout
Clear text
RISORSE ONLINE
- Ghitub: rur-ple
- Sourgeforge
- Google Code: rur-ple
- Wikipedia: RUR-PLE
- Reeborg’s world (nuova versione online)