rric

colour_me_beautiful

Oct 9th, 2023 (edited)
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.43 KB | None | 0 0
  1. # Extended "Hello World" showing text attributes and colours
  2. # Copyright 2022, 2023 Roland Richter
  3.  
  4. # Create a quadratic 600×600 display window
  5. size(600, 600)
  6.  
  7. # Set the background to "Pansy purple"
  8. # HINT Look up color names at http://latexcolor.com/
  9. #      or https://www.w3schools.com/colors/colors_names.asp
  10. background("#78184A")
  11.  
  12. # TRY to increase the text's readability
  13. # textAlign(CENTER)
  14. # textSize(24)
  15.  
  16. # QUIZ You know what color this is, don't you?
  17. fill("#FFFFFF")
  18.    
  19. # Say hello to everyone at the center of the canvas
  20. text("Hello canvas!", 300, 300)
  21. text("It is exciting", 280, 340)
  22. text("to learn Python", 320, 350)
  23.  
  24. # QUIZ Where does the output of the print(...) command appear?
  25. print("Hello console!")
  26.  
  27.  
  28. # ----------------------------------------------------------------------
  29. # This program is free software: you can redistribute it and/or modify
  30. # it under the terms of the GNU General Public License as published by
  31. # the Free Software Foundation, either version 3 of the License, or
  32. # (at your option) any later version.
  33. #
  34. # This program is distributed in the hope that it will be useful,
  35. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  36. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  37. # GNU General Public License for more details.
  38. #
  39. # You should have received a copy of the GNU General Public License
  40. # along with this program.  If not, see <https://www.gnu.org/licenses/>.
Advertisement
Add Comment
Please, Sign In to add comment