Advertisement
BigBlow_

Untitled

Nov 11th, 2024
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. -- Initialiser le moniteur
  2. local mon = peripheral.wrap("top")
  3. mon.setBackgroundColor(colors.black)
  4. mon.clear()
  5. mon.setTextScale(0.5) -- Réduit l'échelle pour plus de détails
  6.  
  7. -- Fonction pour dessiner un cercle simplifié (un disque rempli)
  8. local function drawCircle(x, y, radius, color)
  9. mon.setBackgroundColor(color)
  10. for i = -radius, radius do
  11. for j = -radius, radius do
  12. if i * i + j * j <= radius * radius then
  13. mon.setCursorPos(x + i, y + j)
  14. mon.write(" ")
  15. end
  16. end
  17. end
  18. end
  19.  
  20. -- Fonction pour dessiner les "branches" du symbole nucléaire
  21. local function drawNuclearSymbol()
  22. -- Paramètres pour centrer le symbole
  23. local centerX, centerY = 9, 5 -- Ajuster selon la taille de l’écran
  24.  
  25. -- Couleurs
  26. local yellow = colors.yellow
  27. local black = colors.black
  28.  
  29. -- Dessiner le cercle jaune pour le logo de fond
  30. drawCircle(centerX, centerY, 4, yellow)
  31.  
  32. -- Dessiner les trois branches noires
  33. mon.setBackgroundColor(black)
  34.  
  35. -- Branche 1 (haut)
  36. for i = 0, 3 do
  37. mon.setCursorPos(centerX, centerY - i)
  38. mon.write(" ")
  39. end
  40.  
  41. -- Branche 2 (bas gauche)
  42. for i = 0, 3 do
  43. mon.setCursorPos(centerX - i, centerY + i)
  44. mon.write(" ")
  45. end
  46.  
  47. -- Branche 3 (bas droite)
  48. for i = 0, 3 do
  49. mon.setCursorPos(centerX + i, centerY + i)
  50. mon.write(" ")
  51. end
  52.  
  53. -- Petit cercle noir au centre
  54. drawCircle(centerX, centerY, 1, black)
  55. end
  56.  
  57. -- Effacer l'ecran et dessiner le logo
  58. mon.clear()
  59. drawNuclearSymbol()
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement