Class 13 — Monday February 11
Take 2 — nested looping
It's pillow talk time – For graphical programming – And being visual
Look both ways
Agenda
- Doing loop the loops
Feedback
- Please supply
If you have not yet done so, for the fun of it
- Reveal one of your super power(s).
- Share a selfie.
Downloads
- Program rabular.py
- Module image_support.py
- Program chill.py
- Program axes.py
- Program test_pattern.py
- Program peek_a_boo.py
- Program pixel_throwing.py
To do list
- Review class artifacts.
- Do digit_box.py homework.
Another take on nested looping — building a table
- Program rabular.py
- Demonstrates nested looping process and the building of a table
Three program runs
Enter number of rows: 2
Enter number of columns: 5
Enter a word: banana
row: o
row: 1
row: 0 column: 0
row: 0 column: 1
row: 0 column: 2
row: 0 column: 0
row: 0 column: 1
row: 0 column: 2
row: 0 column: 3
row: 0 column: 4
row: 1 column: 0
row: 1 column: 1
row: 1 column: 2
row: 1 column: 3
row: 1 column: 4
[83, 43, 11, 14, 19]
[88, 27, 84, 15, 92]
[[83, 43, 11, 14, 19], [88, 27, 84, 15, 92]]
Enter number of rows: 2
Enter number of columns: 5
Enter a word: lemon
row: o
row: 1
row: 0 column: 0
row: 0 column: 1
row: 0 column: 2
row: 0 column: 0
row: 0 column: 1
row: 0 column: 2
row: 0 column: 3
row: 0 column: 4
row: 1 column: 0
row: 1 column: 1
row: 1 column: 2
row: 1 column: 3
row: 1 column: 4
[82, 22, 39, 46, 31]
[59, 98, 65, 30, 60]
[[82, 22, 39, 46, 31], [59, 98, 65, 30, 60]]
Enter number of rows: 4
Enter number of columns: 3
Enter a word: apple
row: 0
row: 1
row: 2
row: 3
row: 0 column: 0
row: 0 column: 1
row: 0 column: 2
row: 1 column: 0
row: 1 column: 1
row: 1 column: 2
row: 2 column: 0
row: 2 column: 1
row: 2 column: 2
row: 3 column: 0
row: 3 column: 1
row: 3 column: 2
[53, 25, 27]
[73, 69, 67]
[95, 33, 57]
[96, 18, 99]
[[53, 25, 27], [73, 69, 67], [95, 33, 57], [96, 18, 99]]
Imaging
- Program chill.py
- Creates a user-specified blank image
Enter width and height of interest: 600 450
Enter email id: mst3k
- Program axes.py
Enter email id: mst3k
- Program test_pattern.py
Enter image width and height (pixels): 600 450
- Program peek_a_boo.py
Enter email id: mst3k
- Program pixel_throwing.py
Enter email id: mst3k
© 2019 Jim Cohoon | Resources from previous semesters are available. |