Lesson Plans – Week of 2018-03-04

Lesson Plans – Week of 2018-03-04

  • (1 A/B) Principles of Applied Engineering
  • (2A) Computer Science 1
  • (2B) Computer Science 2
  • (3A) Robotics 1 / Robotics 2 / FTC 11242
  • (3B) Robotics 1 / Robotics 2 / FTC 12645
  • (4A) Computer Science 1
  • (5 A/B) Principles of Applied Engineering

Eric Evans – Planboard Week – 2018-03-04

Finishing the Matrix

Today, we finished the assignment over a matrix (2-dimensional array) in Python by calculating the ranking points for the teams in the FIRST Tech Challenge El Dorado League of North Texas for the 2017/2018 season.

As you may recall from the previous post titled “Continuing the Matrix“, when there is a tie in the qualifying points, the 3 highest ranking points for each team are summed together to break the tie. The team with the higher sum wins the tie-break.

I am going to remove lines 147 to 157 from last class, which was a test print and am going to replace them with the following to calculate the sum of the 3 highest ranking points.

teams[0][13] = (teams[0][5] + teams[0][7] + teams[0][9] + teams[0][11]) - min(teams[0][5], teams[0][7], teams[0][9], teams[0][11])
teams[1][13] = (teams[1][5] + teams[1][7] + teams[1][9] + teams[1][11]) - min(teams[1][5], teams[1][7], teams[1][9], teams[1][11])
teams[2][13] = (teams[2][5] + teams[2][7] + teams[2][9] + teams[2][11]) - min(teams[2][5], teams[2][7], teams[2][9], teams[2][11])
teams[3][13] = (teams[3][5] + teams[3][7] + teams[3][9] + teams[3][11]) - min(teams[3][5], teams[3][7], teams[3][9], teams[3][11])
teams[4][13] = (teams[4][5] + teams[4][7] + teams[4][9] + teams[4][11]) - min(teams[4][5], teams[4][7], teams[4][9], teams[4][11])
teams[5][13] = (teams[5][5] + teams[5][7] + teams[5][9] + teams[5][11]) - min(teams[5][5], teams[5][7], teams[5][9], teams[5][11])
teams[6][13] = (teams[6][5] + teams[6][7] + teams[6][9] + teams[6][11]) - min(teams[6][5], teams[6][7], teams[6][9], teams[6][11])
teams[7][13] = (teams[7][5] + teams[7][7] + teams[7][9] + teams[7][11]) - min(teams[7][5], teams[7][7], teams[7][9], teams[7][11])
teams[8][13] = (teams[8][5] + teams[8][7] + teams[8][9] + teams[8][11]) - min(teams[8][5], teams[8][7], teams[8][9], teams[8][11])
teams[9][13] = (teams[9][5] + teams[9][7] + teams[9][9] + teams[9][11]) - min(teams[9][5], teams[9][7], teams[9][9], teams[9][11])
teams[10][13] = (teams[10][5] + teams[10][7] + teams[10][9] + teams[10][11]) - min(teams[10][5], teams[10][7], teams[10][9], teams[10][11])

Let’s take a look at what we have going on here by just taking a look at the first line in this code segment:

teams[0][13] = (teams[0][5] + teams[0][7] + teams[0][9] + teams[0][11]) - min(teams[0][5], teams[0][7], teams[0][9], teams[0][11])

As you can see, we start by saying that we are going to populate column with 13 with some data. That data is the value of columns 5, 7, 9, & 11 added together and then the smallest of those values subtracted from that sum.

Remember, only the top 3 scores are used in the calculation and it we add the 4 scores together and then subtract the smallest (min) from that total, we get the data we need.

We now need to display our data.

print(teams[0][0] + " - " + teams[0][1] + " - " + str(teams[0][12]) + " (" + str(teams[0][13]) + ")")
print(teams[1][0] + " - " + teams[1][1]  + " - " + str(teams[1][12]) + " (" + str(teams[1][13]) + ")")
print(teams[2][0] + " - " + teams[2][1]  + " - " + str(teams[2][12]) + " (" + str(teams[2][13]) + ")")
print(teams[3][0] + " - " + teams[3][1]  + " - " + str(teams[3][12]) + " (" + str(teams[3][13]) + ")")
print(teams[4][0] + " - " + teams[4][1]  + " - " + str(teams[4][12]) + " (" + str(teams[4][13]) + ")")
print(teams[5][0] + " - " + teams[5][1]  + " - " + str(teams[5][12]) + " (" + str(teams[5][13]) + ")")
print(teams[6][0] + " - " + teams[6][1]  + " - " + str(teams[6][12]) + " (" + str(teams[6][13]) + ")")
print(teams[7][0] + " - " + teams[7][1]  + " - " + str(teams[7][12]) + " (" + str(teams[7][13]) + ")")
print(teams[8][0] + " - " + teams[8][1]  + " - " + str(teams[8][12]) + " (" + str(teams[8][13]) + ")")
print(teams[9][0] + " - " + teams[9][1]  + " - " + str(teams[9][12]) + " (" + str(teams[9][13]) + ")")
print(teams[10][0] + " - " + teams[10][1]  + " - " + str(teams[10][12]) + " (" + str(teams[10][13]) + ")")

Let’s take a look at what we have going on here by just taking a look at the first line in this code segment:

print(teams[0][0] + " - " + teams[0][1] + " - " + str(teams[0][12]) + " (" + str(teams[0][13]) + ")")

Here, we are displaying a concatenation of the team number from column 0, with a space/hyphen/space, with the team name from column 1, with a space/hyphen/space, with the sum of the qualifying points for the team from column 12, with a space, with the sum of the three highest ranking points in parenthesis from column 13.

The output should look like the following:

Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux

127 - The Fighting Pickles - 23 (867)
5443 - Synergy - 18 (737)
9402 - Hive of Steel - 15 (739)
9403 - CyberSwarm - 29 (932)
10143 - Bits & Bots - 14 (763)
11085 - Mad Hackers - 16 (718)
11242 - ERROR 451 - 28 (812)
12645 - S.C.R.E.W. Ups - 19 (874)
12650 - Cannot Compute - 12 (673)
12992 - Vindicators - 6 (316)
13915 - Eagles Robotics - 14 (407)

Following is a complete overview of the code that was created over the 3 days of this lesson:

w = 14 #Width of matrix
h = 11 #Height of matrix
teams = [[0 for x in range(w)] for y in range(h)]
teams[0][0] = "127"
teams[1][0] = "5443"
teams[2][0] = "9402"
teams[3][0] = "9403"
teams[4][0] = "10143"
teams[5][0] = "11085"
teams[6][0] = "11242"
teams[7][0] = "12645"
teams[8][0] = "12650"
teams[9][0] = "12992"
teams[10][0] = "13915"
teams[0][1] = "The Fighting Pickles"
teams[1][1] = "Synergy"
teams[2][1] = "Hive of Steel"
teams[3][1] = "CyberSwarm"
teams[4][1] = "Bits & Bots"
teams[5][1] = "Mad Hackers"
teams[6][1] = "ERROR 451"
teams[7][1] = "S.C.R.E.W. Ups"
teams[8][1] = "Cannot Compute"
teams[9][1] = "Vindicators"
teams[10][1] = "Eagles Robotics"
teams[0][2] = "Ben Barber Innovation Academy"
teams[1][2] = "Harmony School of Innovation"
teams[2][2] = "Henderson Junior High School"
teams[3][2] = "Henderson Junior High School"
teams[4][2] = "Harmony School of Innovation"
teams[5][2] = "Mansfield High School"
teams[6][2] = "Ferris High School"
teams[7][2] = "Ferris High School"
teams[8][2] = "Ferris Junior High School"
teams[9][2] = "Italy High School"
teams[10][2] = "Faith Family Academy"
teams[0][3] = "Mansfield, TX"
teams[1][3] = "Ft. Worth, TX"
teams[2][3] = "Stephenville, TX"
teams[3][3] = "Stephenville, TX"
teams[4][3] = "Ft. Worth, TX"
teams[5][3] = "Mansfield, TX"
teams[6][3] = "Ferris, TX"
teams[7][3] = "Ferris, TX"
teams[8][3] = "Ferris, TX"
teams[9][3] = "Italy, TX"
teams[10][3] = "Waxahachie, TX"
teams[0][4] = 6
teams[1][4] = 0
teams[2][4] = 2
teams[3][4] = 6
teams[4][4] = 6
teams[5][4] = 4
teams[6][4] = 10
teams[7][4] = 6
teams[8][4] = 6
teams[9][4] = 4
teams[10][4] = 0
teams[0][5] = 210
teams[1][5] = 105
teams[2][5] = 132
teams[3][5] = 183
teams[4][5] = 212
teams[5][5] = 184
teams[6][5] = 220
teams[7][5] = 156
teams[8][5] = 160
teams[9][5] = 164
teams[10][5] = 0
teams[0][6] = 6
teams[1][6] = 4
teams[2][6] = 4
teams[3][6] = 10
teams[4][6] = 2
teams[5][6] = 0
teams[6][6] = 6
teams[7][6] = 4
teams[8][6] = 4
teams[9][6] = 0
teams[10][6] = 0
teams[0][7] = 257
teams[1][7] = 257
teams[2][7] = 220
teams[3][7] = 314
teams[4][7] = 205
teams[5][7] = 0
teams[6][7] = 238
teams[7][7] = 277
teams[8][7] = 224
teams[9][7] = 0
teams[10][7] = 0
teams[0][8] = 6
teams[1][8] = 6
teams[2][8] = 6
teams[3][8] = 6
teams[4][8] = 4
teams[5][8] = 6
teams[6][8] = 6
teams[7][8] = 6
teams[8][8] = 0
teams[9][8] = 2
teams[10][8] = 6
teams[0][9] = 188
teams[1][9] = 168
teams[2][9] = 156
teams[3][9] = 218
teams[4][9] = 160
teams[5][9] = 202
teams[6][9] = 244
teams[7][9] = 184
teams[8][9] = 156
teams[9][9] = 152
teams[10][9] = 140
teams[0][10] = 5
teams[1][10] = 8
teams[2][10] = 3
teams[3][10] = 7
teams[4][10] = 2
teams[5][10] = 6
teams[6][10] = 6
teams[7][10] = 3
teams[8][10] = 2
teams[9][10] = 0
teams[10][10] = 8
teams[0][11] = 400
teams[1][11] = 312
teams[2][11] = 363
teams[3][11] = 400
teams[4][11] = 346
teams[5][11] = 332
teams[6][11] = 330
teams[7][11] = 413
teams[8][11] = 289
teams[9][11] = 0
teams[10][11] = 267
teams[0][12] = teams[0][4] + teams[0][6] + teams[0][8] + teams [0][10]
teams[1][12] = teams[1][4] + teams[1][6] + teams[1][8] + teams [1][10]
teams[2][12] = teams[2][4] + teams[2][6] + teams[2][8] + teams [2][10]
teams[3][12] = teams[3][4] + teams[3][6] + teams[3][8] + teams [3][10]
teams[4][12] = teams[4][4] + teams[4][6] + teams[4][8] + teams [4][10]
teams[5][12] = teams[5][4] + teams[5][6] + teams[5][8] + teams [5][10]
teams[6][12] = teams[6][4] + teams[6][6] + teams[6][8] + teams [6][10]
teams[7][12] = teams[7][4] + teams[7][6] + teams[7][8] + teams [7][10]
teams[8][12] = teams[8][4] + teams[8][6] + teams[8][8] + teams [8][10]
teams[9][12] = teams[9][4] + teams[9][6] + teams[9][8] + teams [9][10]
teams[10][12] = teams[10][4] + teams[10][6] + teams[10][8] + teams [10][10]
teams[0][13] = (teams[0][5] + teams[0][7] + teams[0][9] + teams[0][11]) - min(teams[0][5], teams[0][7], teams[0][9], teams[0][11])
teams[1][13] = (teams[1][5] + teams[1][7] + teams[1][9] + teams[1][11]) - min(teams[1][5], teams[1][7], teams[1][9], teams[1][11])
teams[2][13] = (teams[2][5] + teams[2][7] + teams[2][9] + teams[2][11]) - min(teams[2][5], teams[2][7], teams[2][9], teams[2][11])
teams[3][13] = (teams[3][5] + teams[3][7] + teams[3][9] + teams[3][11]) - min(teams[3][5], teams[3][7], teams[3][9], teams[3][11])
teams[4][13] = (teams[4][5] + teams[4][7] + teams[4][9] + teams[4][11]) - min(teams[4][5], teams[4][7], teams[4][9], teams[4][11])
teams[5][13] = (teams[5][5] + teams[5][7] + teams[5][9] + teams[5][11]) - min(teams[5][5], teams[5][7], teams[5][9], teams[5][11])
teams[6][13] = (teams[6][5] + teams[6][7] + teams[6][9] + teams[6][11]) - min(teams[6][5], teams[6][7], teams[6][9], teams[6][11])
teams[7][13] = (teams[7][5] + teams[7][7] + teams[7][9] + teams[7][11]) - min(teams[7][5], teams[7][7], teams[7][9], teams[7][11])
teams[8][13] = (teams[8][5] + teams[8][7] + teams[8][9] + teams[8][11]) - min(teams[8][5], teams[8][7], teams[8][9], teams[8][11])
teams[9][13] = (teams[9][5] + teams[9][7] + teams[9][9] + teams[9][11]) - min(teams[9][5], teams[9][7], teams[9][9], teams[9][11])
teams[10][13] = (teams[10][5] + teams[10][7] + teams[10][9] + teams[10][11]) - min(teams[10][5], teams[10][7], teams[10][9], teams[10][11])
print(teams[0][0] + " - " + teams[0][1] + " - " + str(teams[0][12]) + " (" + str(teams[0][13]) + ")")
print(teams[1][0] + " - " + teams[1][1]  + " - " + str(teams[1][12]) + " (" + str(teams[1][13]) + ")")
print(teams[2][0] + " - " + teams[2][1]  + " - " + str(teams[2][12]) + " (" + str(teams[2][13]) + ")")
print(teams[3][0] + " - " + teams[3][1]  + " - " + str(teams[3][12]) + " (" + str(teams[3][13]) + ")")
print(teams[4][0] + " - " + teams[4][1]  + " - " + str(teams[4][12]) + " (" + str(teams[4][13]) + ")")
print(teams[5][0] + " - " + teams[5][1]  + " - " + str(teams[5][12]) + " (" + str(teams[5][13]) + ")")
print(teams[6][0] + " - " + teams[6][1]  + " - " + str(teams[6][12]) + " (" + str(teams[6][13]) + ")")
print(teams[7][0] + " - " + teams[7][1]  + " - " + str(teams[7][12]) + " (" + str(teams[7][13]) + ")")
print(teams[8][0] + " - " + teams[8][1]  + " - " + str(teams[8][12]) + " (" + str(teams[8][13]) + ")")
print(teams[9][0] + " - " + teams[9][1]  + " - " + str(teams[9][12]) + " (" + str(teams[9][13]) + ")")
print(teams[10][0] + " - " + teams[10][1]  + " - " + str(teams[10][12]) + " (" + str(teams[10][13]) + ")")

 

Continuing the Matrix

Today, we continued the matrix (2-dimensional array) in Python in Computer Science 1. We added an additional 88 data points to the existing 44 we started with. This brings the total number of points to 132.

See the post entitled “Starting a Matrix in Python” for the first part of the program code.

Now, we are going to remove lines 48 through 58 of the code to continue entering data.

teams[0][4] = 6
teams[1][4] = 0
teams[2][4] = 2
teams[3][4] = 6
teams[4][4] = 6
teams[5][4] = 4
teams[6][4] = 10
teams[7][4] = 6
teams[8][4] = 6
teams[9][4] = 4
teams[10][4] = 0
teams[0][5] = 210
teams[1][5] = 105
teams[2][5] = 132
teams[3][5] = 183
teams[4][5] = 212
teams[5][5] = 184
teams[6][5] = 220
teams[7][5] = 156
teams[8][5] = 160
teams[9][5] = 164
teams[10][5] = 0

Here, we are adding the scores for each team from the first league meet of the 2017/2018 season as new columns 4 and 5 to the array. You can see these are being entered as integers as we will be doing some math with them later.

teams[0][6] = 6
teams[1][6] = 4
teams[2][6] = 4
teams[3][6] = 10
teams[4][6] = 2
teams[5][6] = 0
teams[6][6] = 6
teams[7][6] = 4
teams[8][6] = 4
teams[9][6] = 0
teams[10][6] = 0
teams[0][7] = 257
teams[1][7] = 257
teams[2][7] = 220
teams[3][7] = 314
teams[4][7] = 205
teams[5][7] = 0
teams[6][7] = 238
teams[7][7] = 277
teams[8][7] = 224
teams[9][7] = 0
teams[10][7] = 0

We are now adding the scores from each team from the second league meet of the 2017/2018 season as new columns 6 and 7 to the array.

teams[0][8] = 6
teams[1][8] = 6
teams[2][8] = 6
teams[3][8] = 6
teams[4][8] = 4
teams[5][8] = 6
teams[6][8] = 6
teams[7][8] = 6
teams[8][8] = 0
teams[9][8] = 2
teams[10][8] = 6
teams[0][9] = 188
teams[1][9] = 168
teams[2][9] = 156
teams[3][9] = 218
teams[4][9] = 160
teams[5][9] = 202
teams[6][9] = 244
teams[7][9] = 184
teams[8][9] = 156
teams[9][9] = 152
teams[10][9] = 140

We are now adding the scores from each teams from the third league meet of the 2017/2018 season as new columns 8 and 9 to the array.

teams[0][10] = 5
teams[1][10] = 8
teams[2][10] = 3
teams[3][10] = 7
teams[4][10] = 2
teams[5][10] = 6
teams[6][10] = 6
teams[7][10] = 3
teams[8][10] = 2
teams[9][10] = 0
teams[10][10] = 8
teams[0][11] = 400
teams[1][11] = 312
teams[2][11] = 363
teams[3][11] = 400
teams[4][11] = 346
teams[5][11] = 332
teams[6][11] = 330
teams[7][11] = 413
teams[8][11] = 289
teams[9][11] = 0
teams[10][11] = 267

We now add the results from the league tournament final qualifying rounds of the 2017/2018 season as new columns 10 and 11 to the array.

Now, what we need to do is calculate the total qualifying points, which determines placement. This is done by calculating the sum of all qualifying points for each team individually. This was stored in columns 4, 6, 8, & 10 in the array.

In the event of a tie in the qualifying points, we take the sum of the 3 highest ranking points scores for each team. The team with the higher ranking points wins the tie-break. The ranking points are stored in columns 5, 7, 9, & 11 in the array.

Calculating the qualifying points for each team is somewhat easy and can be done using simple arithmetic functions.

teams[0][12] = teams[0][4] + teams[0][6] + teams[0][8] + teams [0][10]
teams[1][12] = teams[1][4] + teams[1][6] + teams[1][8] + teams [1][10]
teams[2][12] = teams[2][4] + teams[2][6] + teams[2][8] + teams [2][10]
teams[3][12] = teams[3][4] + teams[3][6] + teams[3][8] + teams [3][10]
teams[4][12] = teams[4][4] + teams[4][6] + teams[4][8] + teams [4][10]
teams[5][12] = teams[5][4] + teams[5][6] + teams[5][8] + teams [5][10]
teams[6][12] = teams[6][4] + teams[6][6] + teams[6][8] + teams [6][10]
teams[7][12] = teams[7][4] + teams[7][6] + teams[7][8] + teams [7][10]
teams[8][12] = teams[8][4] + teams[8][6] + teams[8][8] + teams [8][10]
teams[9][12] = teams[9][4] + teams[9][6] + teams[9][8] + teams [9][10]
teams[10][12] = teams[10][4] + teams[10][6] + teams[10][8] + teams [10][10]

As you can see, we have added column 12 to the array and it holds the sum of columns 4, 6, 8, & 10 for the given row. This is the total qualifying points.

We can add a “test-print” using the following:

print(teams[0][0] + " - " + str(teams[0][12]))
print(teams[1][0] + " - " + str(teams[1][12]))
print(teams[2][0] + " - " + str(teams[2][12]))
print(teams[3][0] + " - " + str(teams[3][12]))
print(teams[4][0] + " - " + str(teams[4][12]))
print(teams[5][0] + " - " + str(teams[5][12]))
print(teams[6][0] + " - " + str(teams[6][12]))
print(teams[7][0] + " - " + str(teams[7][12]))
print(teams[8][0] + " - " + str(teams[8][12]))
print(teams[9][0] + " - " + str(teams[9][12]))
print(teams[10][0] + " - " + str(teams[10][12]))

You can see that we are displaying the team number from column 0, concatenated with a space a hyphen and space, which is then concatenated with the values from column 12 cast as a string.

The output looks similar to the following:

Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux

127 - 23
5443 - 18
9402 - 15
9403 - 29
10143 - 14
11085 - 16
11242 - 28
12645 - 19
12650 - 12
12992 - 6
13915 - 14

Next class, we will take a look at how to calculate the tie-breaker. As you can see, it will be needed as there is a tie between FTC 10143 and FTC 13915.

Clean Classroom = Crazy Mind

As we come into the end of February, I have a strange thing happening in my classroom – it’s clean!

Usually, my classroom is a “vortex of chaotic creation”. We usually have tools, robots, computer parts, a robotics competition game floor, and an assortment of other random materials laying about in the classroom on tables and in cabinets.

As you can see, the robotics floor is out of the room and that opens up a massive amount of room!

We also have everything in the robotics closet organized!

We have all of the parts sorted in various bins and trays now and they are labeled. We can actually find stuff pretty quickly now!

We now have a dedicated “clean-up” time at the conclusion of each robotics class to ensure that everything gets put away in its proper place.

I am very happy to have a clean room, for the moment. It is very “unlike” me and has led a few to wonder if I have gone crazy!

Starting a Matrix in Python

I started working with a 2-dimensional array in Python with my students today. We first covered a basic table on paper with the letters of the alphabet populating the cells so they could read index coordinates.

We then moved to the problem. On the first day of this assignment, we worked to create an 11 X 4 table that holds information of the teams that formed the FIRST Tech Challenge El Dorado League of North Texas for the 2017/2018 Relic Recovery season.

26-February-2018 – Matrix Day 1 Data – Sheet1

This is a visual representation of the data we worked with today.

w = 4
h = 11
teams = [[0 for x in range(w)] for y in range(h)]

Here, we declared an integer variable named “w” and another named “h” and assigned the values 4 and 11 respectively. This represents the width and height of the array we are building.

On line 3, we create the array named teams and using a nested for loop, create the array that is 4 columns wide and 11 rows tall. The table is currently populated with zeros.

teams[0][0] = "127"
teams[1][0] = "5443"
teams[2][0] = "9402"
teams[3][0] = "9403"
teams[4][0] = "10143"
teams[5][0] = "11085"
teams[6][0] = "11242"
teams[7][0] = "12645"
teams[8][0] = "12650"
teams[9][0] = "12992"
teams[10][0] = "13915"

These lines are populating column 0 (first column) of the array with the team numbers of the 11 different FTC teams in the league. Please note that it only goes up to 10 since we start counting at 0.

teams[0][1] = "The Fighting Pickles"
teams[1][1] = "Synergy"
teams[2][1] = "Hive of Steel"
teams[3][1] = "CyberSwarm"
teams[4][1] = "Bit & Bots"
teams[5][1] = "Mad Hackers"
teams[6][1] = "ERROR 451"
teams[7][1] = "S.C.R.E.W. Ups"
teams[8][1] = "Cannot Compute"
teams[9][1] = "Vindicators"
teams[10][1] = "Eagles Robotics"

These lines are populating column 1 (second column) of the array with the team names.

teams[0][2] = "Ben Barber Innovation Academy"
teams[1][2] = "Harmony School of Innovation"
teams[2][2] = "Henderson Junior High School"
teams[3][2] = "Henderson Junior High School"
teams[4][2] = "Harmony School of Innovation"
teams[5][2] = "Mansfield High School"
teams[6][2] = "Ferris High School"
teams[7][2] = "Ferris High School"
teams[8][2] = "Ferris Junior High School"
teams[9][2] = "Italy High School"
teams[10}[2] = "Faith Family Academy"

These lines are populating column 2 (third column) of the array with the schools each team represents.

teams[0][3] = "Mansfield, TX"
teams[1][3] = "Ft. Worth, TX"
teams[2][3] = "Stephenville, TX"
teams[3][3] = "Stephenville, TX"
teams[4][3] = "Ft. Worth, TX"
teams[5][3] = "Mansfield, TX"
teams[6][3] = "Ferris, TX"
teams[7][3] = "Ferris, TX"
teams[8][3] = "Ferris, TX"
teams[9][3] = "Italy, TX"
teams[10][3] = "Waxahachie, TX"

These lines are populating column 3 (fourth column) of the array with the hometowns of each team.

print(teams[0])
print(teams[1])
print(teams[2])
print(teams[3])
print(teams[4])
print(teams[5])
print(teams[6])
print(teams[7])
print(teams[8])
print(teams[9])
print(teams[10])

These lines will print each of the 11 rows on a separate line. There is no formatting, so the output will look similar to the following:

Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
['127', 'The Fighting Pickles', 'Ben Barber Innovation Academy', 'Mansfield, TX']
['5443', 'Synergy', 'Harmony School of Innovation', 'Ft. Worth, TX']
['9402', 'Hive of Steel', 'Henderson Junior High School', 'Stephenville, TX']
['9403', 'CyberSwarm', 'Henderson Junior High School', 'Stephenville, TX']
['10143', 'Bits & Bots', 'Harmony School of Innovation', 'Ft. Worth, TX']
['11085', 'Mad Hackers', 'Mansfield High School', 'Mansfield, TX']
['11242', 'ERROR 451', 'Ferris High School', 'Ferris, TX']
['12645', 'S.C.R.E.W. Ups', 'Ferris High School', 'Ferris, TX']
['12650', 'Cannot Compute', 'Ferris Junior High School', 'Ferris, TX']
['12992', 'Vindicators', 'Italy High School', 'Italy, TX']
['13915', 'Eagles Robotics', 'Faith Family Academy', 'Waxahachie, TX']

In the next class, we’ll discuss how to display an individual index and use concatenation to format a better output. We’ll then move into adding additional data to the existing array for each team that will involve basic math.

Houston is “No Go”

The Houston Livestock Show and Rodeo Ag Robotics event is this upcoming weekend (03-March-2018).

Ferris High School had all intentions of competing in this somewhat new event at HLSR this year. Regretfully, we’ve got a student scheduling conflict with UIL Solo & Ensemble and will be unable to attend the HLSR event.

In addition to being down a student, we are honestly not genuinely prepared for the event. While the build would be arguably easier than an FTC build, the programming is infinitely more complex and would rely on numerous bits of sensor data.

Due to the overlap between the FTC season and this event, I was not able to give this the attention it deserved and we were not able to really start working on it until just two weeks ago. That is just not enough time to build and program a competitive robot.

If I had been able to give it the attention it needed, I would make every effort to pull in an additional student to allow us to have a “full” team. However, the loss of one of the students just served as confirmation to me that we were not meant to do this event this year.

I am thinking of doing an “agricultural robotics event” as a possible FFA/FTC Robotics fund-raiser for next year. May look at something similar to the HLSR game or may go a completely different direction.

Lesson Plans – Week of 2018-02-25

Lesson Plans – Week of 2018-02-25

  • (1 A/B) Principles of Applied Engineering
  • (2A) Computer Science 1
  • (2B) Computer Science 2
  • (3A) Robotics 1 / Robotics 2 / FTC 11242
  • (3B) Robotics 1 / Robotics 2 / FTC 12645
  • (4A) Computer Science 1
  • (5 A/B) Principles of Applied Engineering

Eric Evans – Planboard Week – 2018-02-25

Deques of Python Stories

I was introducing deques in my Computer Science 1 class today in Python and decided to tell a story around the lesson. I figured I would share as this seemed to sink-in with my classes.

Zara loves Computer Science and using technology. She is hosting a party with several of her friends and wants to have their names displayed on the screen in the order they arrived and then remove them when they depart.

The friends of Zara are:

  • Alice
  • Betty
  • Christy
  • Darla
  • Elizabeth
  • Fran
  • Ginger
  • Holly

Alice, Betty and Christy arrive at the party at the same time and enter in that order.

from collections import deque
myGuestList = deque(["Alice", "Betty", "Christy"])
print(myGuestList)

At this point, we have 3 guests at the party: Alice in index 0, Betty in index 1, and Christy in index 2.

Darla and Elizabeth arrive at the party at the same time and enter in that order.

myGuestList.append("Darla")
myGuestList.append("Elizabeth")
print(myGuestList)

We now have 5 guests at the party: Alice in index 0, Betty in index 1, Christy in index 2, Darla in index 3, and Elizabeth in index 4.

Alice and Betty H-A-T-E Elizabeth. Almost instantly upon seeing her name on the screen, they both leave the party.

myGuestList.popleft()
myGuestList.popleft()
print(myGuestList)

We now have 3 guests at the party: Christy has now moved to index 0, Darla has moved to index 1, and Elizabeth has moved to index 2.

Ginger and Holly arrive at the party at the same time and enter in that order.

myGuestList.append("Ginger")
myGuestList.append("Holly")
print(myGuestList)

We now have 5 guests at the party: Christy is in index 0, Darla is in index 1, Elizabeth is in index 2, Ginger is in index 3, and Holly is in index 4.

Regretfully, Holly had been to another party before coming to Zara’s party and gets sick when she gets inside and has to leave.

myGuestList.pop()
print(myGuestList)

We now have 4 guests at the party: Christy is in index 0, Darla is in index 1, Elizabeth is in index 2, and Ginger is in index 3.

Elizabeth is Holly’s sister and leaves to take care of her sister and possibly ridicule her for her choice of the day.

del myGuestList[2]
print(myGuestList)

We now have 3 guests at the party: Christy is in index 0, Darla is in index 1, and Ginger who has moved to index 2.

Zara realizes that while the computer shows 3 guests at the party, there are 4 guests there. Somehow, Fran came in right after Elizabeth and did not get entered into the computer during the “drama” between Alice and Betty with Elizabeth. Fran needs to be entered into the correct location.

myGuestList.insert(2,"Fran")
print(myGuestList)

We now have 4 guests at the party: Christy is in index 0, Darla is in index 1, Fran in index 2, and Ginger who has moved to index 3.

Zara realizes that there is one person who has been there the entire time, but is not on the list – herself. Since she has been there the entire time, she should be placed at the bottom of the deque.

myGuestList.appendleft("Zara")
print(myGuestList)

We now have 5 people at the party: Zara is in index 0, Christy moves index 1, Darla moves to index 2, Fran moves to index 3, and Ginger moves to index 4.

Everyone, including Zara agrees that the party is pretty lame and that there is a better party down the street. So, everyone is going to leave the party.

myGuestList.clear()
print(myGuestList)

We now have nobody at the party and the deque is empty!

Draft Information Flier for Girls Robotics Summer Camps

Well, it’s looking like it’s going to be more and more of a reality. As we approach the end of February and wrap-up a successful week of touring at Ferris Intermediate with the FTC 11242 robot, it’s time to get an information flier ready for our girls robotics summer camps.

Still have a few logistical issues to iron-down and these fliers will be ready for prime-time. Hopefully, they’ll be ready to go out this time next week.

Number Conversions from Base 10

I have written a few posts (Post 1, Post 2, & Post 3) concerning various base number systems. In all of these posts, I covered how to convert from a non-decimal base into a decimal base. In other words, I covered how to get INTO base-10. This post is going to cover the inverse (decimal base into non-decimal base).

Modulus

We will need to start by reviewing the concept of modulus division. Let’s look at the standard division problem 5/2. We would typically say that the answer is 2.5 and this would be correct.

Now, modulus is simply the remainder of a division problem. Go back to when you were first introduced to division. In Texas, this is typically in 4th grade. Let’s take a look at that division problem of 5/2 again. When you were learning division, you would have said the answer was 2r1. The 1 is the modulus. When we’re writing the problem to just solve modulus, we would write it as 5%2.

Mechanics

Decimal to Octal

Let’s say that we have the decimal number (base 10) 4,814 and we want to convert it to an octal (base 8).

We will be building the number from right-to-left. The first thing we will do is solve 4,814/8. This equals 601r6. So, our first digit of the solution (starting on the right) is 6.

6

Now, we solve 601/8, which equals 75r1. So, our second digit of the solution (floating from right-to-left) is 1.

16

Now, we solve 75/8, which equals 9r3. So, our third digit of the solution (floating from right-to-left) is 3.

316

Now, we solve 9/8, which equals 1r1. So, out fourth digit of the solution (floating from right-to-left) is 1.

1316

Finally, we solve 1/8, which equals 0r1. So, our fifth and final digit of the solution (floating from right-to-left) is 1.

11316

So, the decimal number (base 10) 4,814 is equal to the octal (base 8) 11316.

As you can see, this is a bit of a process, but once you know the process, it is very simple. I now want to take a look at going to number systems with more digits than base 10, for example: base 16.

Decimal to Hexadecimal

Let’s say that we have the decimal number (base 10) 4,814 and we want to convert it to a HEX (base 16).

We start by solving 4,814/16, which gives us 300r14. Remember, that is number systems with more than 10 digits, we start using letters.

10 = A
11 = B
12 = C
13 = D
14 = E
15 = F

So, the first digit of our solution (building from right-to-left) is E.

E

Now, we solve 300/16, which gives us 18r12. So, the second digit of our solutions (building from right-to-left) is C.

CE

Now, we solve 18/16, which gives us 1r2. So, the third digit of our solution (building from right-to-left) is 2.

2CE

Finally, we solve 1/16, which gives us 0r1. So, the fourth digit of our solution (building from right-to-left) is 1.

12CE

So, the decimal number (base 10) 4,814 is equal to the hexadecimal (base 16) 12CE.