albertohilal

Clase 5 Ejercicio 4.2.1

Sep 6th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. /*Escribir un procedimiento GuardaDePares, que permita realizar
  2. una guarda de bolitas verdes similar a la del grafico G.4.1.
  3. Utilizar dos repeticiones indexadas, adaptando los
  4. ındices de manera conveniente.*/
  5.  
  6. procedure PonerNVerde(color,cant){
  7. repeatWith i in 1..cant
  8. {Poner(color)}
  9. Mover(Este)
  10. }
  11.  
  12. procedure GuardaDePares(n){
  13. repeatWith i in 1..n
  14. {PonerNVerde(Verde,2*i)}
  15. repeatWith i in 1..n
  16. {PonerNVerde(Verde,12-(2*i))}
  17. }
  18.  
  19. procedure Main(){
  20. GuardaDePares(5)
  21. }
Advertisement
Add Comment
Please, Sign In to add comment