Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Extended "Hello World" showing text attributes and colours
- # Copyright 2022, 2023 Roland Richter
- # Create a quadratic 600×600 display window
- size(600, 600)
- # Set the background to "Pansy purple"
- # HINT Look up color names at http://latexcolor.com/
- # or https://www.w3schools.com/colors/colors_names.asp
- background("#78184A")
- # TRY to increase the text's readability
- # textAlign(CENTER)
- # textSize(24)
- # QUIZ You know what color this is, don't you?
- fill("#FFFFFF")
- # Say hello to everyone at the center of the canvas
- text("Hello canvas!", 300, 300)
- text("It is exciting", 280, 340)
- text("to learn Python", 320, 350)
- # QUIZ Where does the output of the print(...) command appear?
- print("Hello console!")
- # ----------------------------------------------------------------------
- # This program is free software: you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program. If not, see <https://www.gnu.org/licenses/>.
Advertisement
Add Comment
Please, Sign In to add comment