Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. Action affGrille( E l : entier, E c :entier, E e:entier)
  2.  
  3. var g : TTab2Dim
  4. file : TFile de {TTab2Dim {entier, entier}}
  5. x,y,k,lig,col,ind : entier
  6. tmp : TTab2Dim
  7.  
  8. Debut
  9.  
  10. x <- 1
  11. y <- 1
  12. g <- nouvelleGrille(l,c)
  13. file.créerFile()
  14. file.enfiler(g,{x,y})
  15.  
  16. Pour k allant de 1 à l*c faire
  17. |
  18. | Pour lig allant de y à l faire
  19. | |
  20. | | Pour col allant de x à c faire
  21. | | |
  22. | | | Pour ind allant de 1 à e faire
  23. | | | |
  24. | | | | tmp <- copieGrille(file.valeurPremier().premier()
  25. | | | |
  26. | | | | x <- file.valeurPremier().second().premier()
  27. | | | | y <- file.valeurPremier().second().second()
  28. | | | | tmp[x][y] <- ind
  29. | | | | // x <- x+1
  30. | | | |
  31. | | | | Si x >= c alors
  32. | | | | | x <- 1
  33. | | | | | y <- y+1
  34. | | | | |__
  35. | | | | Si y >= l alors
  36. | | | | | y <- l
  37. | | | | | x <- c
  38. | | | | |__
  39. | | | | file.enfiler(tmp,{x,y})
  40. | | | |__
  41. | | |__
  42. | | aff1Grille(file.valeurPremier().premier(), l, c)
  43. | | file.defiler()
  44. | |__
  45. |
  46. |__
  47.  
  48. Après correction
  49. Début
  50. Pour k allant de 1 à l*c faire
  51. |
  52. | Pour lig allant de y à l faire
  53. | |
  54. | | Pour col allant de x à c faire
  55. | | |
  56. | | | Pour ind allant de 1 à e faire
  57. | | | |
  58. | | | | tmp <- copieGrille(file.valeurPremier().premier()
  59. | | | |
  60. | | | | x <- file.valeurPremier().second().premier()
  61. | | | | y <- file.valeurPremier().second().second()
  62. | | | | tmp[x][y] <- ind
  63. | | | | // x <- x+1 j'ai pas compris le but
  64. | | | |
  65. | | | | //Si x >= c alors c'est le pout qui gère ça normalement
  66. | | | | // | x <- 1
  67. | | | | // | y <- y+1
  68. | | | | // |__
  69. | | | | //Si y >= l alors
  70. | | | | // | y <- l
  71. | | | | // | x <- c
  72. | | | | //|__
  73. | | | | file.enfiler(tmp,{x,y})
  74. | | | |__
  75. | | |__
  76. | |
  77. | |
  78. | |__
  79. | aff1Grille(file.valeurPremier().premier(), l, c)
  80. | file.defiler()
  81. |__
  82.  
  83. Fin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement