hour of make up your own code! (a challenge for every wordpress reader)

if youre on wordpress you may have heard of the “hour of code.” i think its a great idea, but if youre thinking of skipping it anyway, why not try the “hour of make up your own code?”

you dont even have to know how coding works to do it. but it could end up being your first step towards learning to code. still reading? ok, heres what you do:

 

1. imagine some things you could tell the computer to do.

 

2. give a name to each of these things you want to tell the computer to do. once you name it, that thing is a “command” for the computer. an example of a command is “uppercase.” it takes words and makes them uppercase– another is “dot.” it draws a dot on the computer, in any colour on any place on the screen.

 

3. (optional) for each command you make up, you can add “parameters.” parameters are details for the command. like for your “dot” command, you could have parameters for how many “dots” from the left side of the screen you want to put it, or how many “dots” from the top you want– or what colour you want to use. parameters look like this:

command parameter1 parameter2 parameter3

 

you can name your parameters if you want to:

dot: fromleft, fromtop, colour

 

4. (bonus) create as many “commands” as you want, then write a program in your new language!

1) dot: 5, 5, “orange”
2) line: 7, 10 – 30, 100 “green”
3) say-on-screen: “hello, this is my program.”

 

5. feel free to post your language ideas or your programs as a reply to this post, or put them on your own blog (or link to them here.) if you like the idea, feel free to copy this entire article to your own blog.

 

 

Advertisements

7 thoughts on “hour of make up your own code! (a challenge for every wordpress reader)

  1. print(“Time for some hypothetical Copper!”) import(“doEverythingLib.cu”) net=Network_createSuperSocket() issues=List() for_members(net.sockets [s, i~issues]{ Push_top(i, World_translateAndParseIssue( Network_collectIssue(s:) )) }) SuperSolver_resolve(issues:) print(” Success! (Super Solver never fails!)”) # Incidentally, technically all of this is valid Copper code and would run in the VM, but it wouldn’t remotely produce the output you might expect. “import” isn’t built-in, but for_members is on the to-do list of things to add. Don’t bother asking about SuperSolver_resolve, lol. #

    Liked by 1 person

  2. Python Tkinter Hour of Code that I have started (this might only last 5 minutes)

    The [TAB] means that you must press the tab key before typing in those lines of code.

    try:
    [TAB]from Tkinter import *
    except ImportError:
    [TAB]from tkinter import * # In cases where Python 3 is installed on the PC
    
    master = Tk()
    master.title("Hour of Code #1")
    master.geometry("500x500")
    
    def new_window():
    [TAB]master2 =Tk ()
    [TAB]master2.title("New Window")
    [TAB]master2.mainloop()
    
    newwindow_open = Button (text=New Window, command=new_window)
    newwindow_open.pack()
    master.pack()
    
    

    I will do more soon.

    Liked by 1 person

    1. cool. here is your code with 4 spaces per tab. some people like tabs better, some ide/editors insert 4 spaces per tab; in this instance its so that wordpress preserves indentation (the trick is to use pre tags)

      try:
          from Tkinter import *
      except ImportError:
          from tkinter import * # In cases where Python 3 is installed on the PC
      master = Tk()
      master.title("Hour of Code #1")
      master.geometry("500x500")
      def new_window():
          master2 =Tk ()
          master2.title("New Window")
          master2.mainloop()
      newwindow_open = Button (text=New Window, command=new_window)
      newwindow_open.pack()
      master.pack()

      Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s