Introduction to programming using Java and graphics

What and how?

This is a course designed to take people from knowing nothing about computer programming to being fairly proficient at it.
(Obviously, your mileage may vary depending on your aptitude and how good you are at problem solving and abstract thinking.)

From personal experience I believe that mentoring is one of the best ways to learn, so this course will be run using Slack. It will be interactive: lessons and instructions will be posted there, and you can ask questions and I’ll answer them, help you when you’re stuck , etc. I think that this is better than just watching a bunch of videos. The other good thing about this, is that when you ask questions, others can answer them too – since I won’t be online 24/7 .

I can probably handle somewhere between 25 and 40 people in this course.

My credentials
I’ve been teaching Java programming to high school students for about 10 years now — so I'm great at taking someone from nothing to fairly competent. Most of my online projects though are PHP based (https://demo.iquark.ca), but I don’t know PHP well enough to teach it. You can see some of my Java stuff at https://github.com/salamander2/functionID and other repositories there. (We’ll be going over a lot of the content found on Salamander2)

Time commitment
It’s hard to estimate this. I think that about 10 hours a week, though you could probably do it with less. Also, I’ll need regular feedback about pacing – am I going too slowly or too fast?

Duration
I don’t really know. It depends on the pacing. I've added the approximate number of hours to do each lesson. At 20 hours + the final project, it looks like this will take 3 weeks (or longer).

Free? Yes. Why?

This course really is free. Normally I teach in a classroom, so I'm still learning about how to package this online. It won't be 100% slick, but that's okay. I would like to eventually offer this as a paid course online. (A paid course means that people are likely to be more committed and less likely to quit for no reason.) All that I want from you is to tell me what works well and what needs improving.

I recommend using Eclipse IDE, but you can use another if you wish.
Everything we do can be done with Java 8. We don’t need and won’t be learning the latest and newest additions.

For graphics, we’ll be using a library (HSA2) specifically designed for ease of use that uses 95% of the same drawing commands as Swing.

Most of the time when I’m introducing a new concept we’ll do a simple text-based program first, then use what we’ve learned in graphics.

Course topics

►► List of lessons and assignments ◄◄

As we get to more complicated programs, we’ll also be learning problem solving, breaking complex tasks down to simpler ones.

I'm gouping topics into "units" or "modules" for ease of reference. Units are not necessarily logically connected, they're just grouped for convenience. (I don't want to have a channel for each topic in Slack, but I can with each unit.)

🄶 graphics based, 🅃 = text based (console),
● = subtopic, ► = assignment to do
(approx hours in parentheses)

  1. Install Eclipse and HSA2 (0-1 hr)
  2. Unit 1
  3. Swing drawing commands. (2 hrs) 🄶
    ► Make a drawing meeting certain criteria
  4. Basic Java (2-3) 🅃
    ● variables, math, data types, scanner, print, if
    ► simple text based calculator: enter two #, enter operation.
    ► Handle errors
    then use switch to replace if for operands
    printf: decimals
  5. While loops and Random numbers (1) 🅃
    ● 4 methods of exiting while loop
    (true & break, condition in (), boolean in (), do-while?)
    ► Use on prev. assignment to allow repetition of calculator
    While loop (1 -2) 🄶
    ► draw random circles on screen, random colours.
    ► Use “JoptionPane” to type in hexcode for background colour
  6. Modulus (< 1) 🅃 . . .
  7. Unit 2
  8. For loops: text based (< 1) 🅃
    ► Write a for loop that prints the numbers 99 down to 0. Do this 4 different ways. The for-loop must be different each time.
    ► You have 6 guesses to guess a random number from 1-10. Use a for loop (normally this would be a while loop)
  9. For loops: graphics (1) 🄶
    ► draw grid lines based on constant GRID.
    e.g. GRID=3 means draw TicTacToe board.
    ► Line art
  10. Pixel graphics (1) 🄶
    (no assignment)
  11. Unit 3
  12. Methods (1?) 🅃
    . . . (not done yet)
    ► split up forloop2 into methods: random, input, process, output
    debugging! (also gc.setTitle)
    Scope!
  13. Graphing Equations (using dots/pixels) (2-3) 🄶
    ► make it resizeable
    ► Optional extra: graphing Mandelbrot set
  14. Unit 4
  15. Structures: intro to Arrays, ArrayLists and Objects (3) 🅃
    (lesson 13 for 🄶)
    ► Second forloop problem: keep track of the guesses you’ve already made. Guessing the same number twice doesn’t count as a guess
    • use a string
    • use an array of booleans
    • use an arraylist
    ► . . . top 5, bottom 5 (from unsorted array)
    ► even indexes are set to 9. Odd indexes are random # from 10-50. Sort the array, only the odd indexes.
  16. Strings. (3 – 6) 🅃
    Strings are the only topic that doesn’t connect to anything else here. However, they are important enough that I can’t really teach programming without including them.

    Get 2nd and last word without splitting into an array.
    Find sum of all letters in string. Or vowels=3, consonants=5; find total
    add 1 to each digit in a string. 9->0

    ● char <--> int, useful methods and algorithms
    ► . . .
    ► random words
    ► hangman?
  17. Unit 5
  18. Animation: ball bounce (1 – 2) 🄶 (no assignment)
  19. MAIN PROJECT: Game loop and polling (8+) 🄶
    • 3 balls, avoid them – move player using mouse. (Objects: Star, Ball)
    • improvements: make 1 ball follow you,
    • add 20 stars that you have to collect to win
    • use array for stars, then use arraylist for stars
    • add Intro screen with instructions and a button to start, maybe to determine game level
    • add keys: P = pause/unpause, Q or ESC = quit
    • Optional: move using WASD or cursor keys
  20. Adding images (background, player), save as JAR file. 🄶
    classpath

— The end for now —