======Part 1====== =====Entries===== ====Entry 1: August 28, 2012==== Today was very much a "deer in the headlights" day for me. I had heard legends about Discrete's level of knowledge and difficulty. As a phrase, "Discrete Mathematics" is intimidating! I worry that my lack of comfort in C programming will cause me to fall behind in the course, but will do all that I can to finish the semester with an A. The class started with a rundown on how to use the IRC chat server. I immediately learned the ins and outs of Rollbot, and how it can be used to distract one from lecture points. The support structure in the chat room, however, should prove to be very useful. I appreciate the ability to connect with students in and out of the classroom, with the hopes of learning from their far-more-advanced skills in computer programming. I also picked a class keyword for the semester, "Right Projection." I had absolutely ZERO.ZERO idea what that would mean, and I was charged with the task of research and implementation of Right Projection. ====Entry 2: September 4th 2012==== Today's class revolved around "Logic." A discussion was opened up as to what "Logic" means, both in formal defintion as well as in layman's terms. Ultimately, I learned that "logic" is defined as "the study of modes of reasoning." As a class, we agreed that logic can quite simply be "stuff that makes programs work." Without logic, our basic computers could not function. As a class, we looked deeper into logic, and created a Truth Table. That truth table took two inputs (P and Q), and a Boolean approach to their states. Boolean reasoning states that a value can either be 0 or 1; True or False. The truth table stretched out to 16 different logic states, and we explored AND, OR, NAND, XOR, etc, including the logic of our keywords. I was able to take the knowledge from the truth table, and begin working on a function to best represent "right projection." ====Entry 3: September 11th, 2012==== I entered class, feeling confident in my right projection program. I was able to not only print a truth table, but also implement right projection. I did so in two ways; first, I showed right projection as it pertains to a truth table using P and Q, where X was the right projection of P, Q. Basically, the value of X will always output the value of Q. Secondly, I included an input parameter, that solicits values from a user for P and Q, and outputs the right projection those inputs. We ended class by discussing the differences between Arrays and Structures. I remembered the concept of Arrays, and how to partially use them from the C/C++ Programming class I had last spring. Structures were new to me, however, and I am intrigued by the functionality and benefits of using Structures. ====Entry 4: September 14th, 2012==== Today we covered "the beginning of the future (which is here now)", in dealing with Linked Lists. According to Matt, what we learned today is the "meat" of Data Structures. We started off with Singly-Linked Lists, and discovered nodes. I learned that nodes contain a value and a pointer. Also, nodes only point to either other nodes or NULL, the list terminator. Drawing out nodes to NULL proved to be helpful, to better visualize how a list should flow. In node-code, we use: struct node{ char value; struct node * next; }; typedef struct node Node; It was very helpful for me that we created a simple, singly-linked list code program in class. I struggle with how to effectively program while working on my own, but find it helpful to take bits and pieces of in-class material, and make minor changes to them. =====Keywords===== {{page>datapart1&nofooter}} {{page>discretepart1&nofooter}} =====Experiment 1===== ====Question==== How can I create a basic Fantasy Football program?? My goal is to start the beginning parts to writing a program that will solicit a user for statistics (yards, touchdowns, turnovers, etc) and convert those stats into a point value that can be stored. ====Resources==== Unfortunately, there are not a lot of resources available for researching Fantasy Football program writing. Multiple searches return how to sign up for fantasy football leagues, how to draft a team and various strategies, but nothing in regards to getting start with writing your own program. I did come across one website, where a student at another school had a similar assignment. His failed code (Java) looks like this: import java.util.Scanner; public class FantasyFootball { private int numberOfTeams; private int numberOfWeeks; private String[] nameOfTeams; private int [][] weeklyScores; private int [] averageScores; public FantasyFootball(int public FantasyFootball() { Scanner keyboard = new Scanner(System.in); //ask for the 2 numbers nameOfTeams = new String[//]; //for loops //to fill the arrays with While this is Java-speak, it follows similar thoughts that I had for a C program. ====Hypothesis==== I'm not ENTIRELY sure of what the "powers that be" are looking for here, but here goes: Conceptually, this task is large but shouldn't be terribly complicated. I should be able to utilize variables for each position scored, and store the values in a struct or an array. The difficulty will come from adding a second team to go head-to-head with in competition, and displaying position match ups and their point totals. ====Experiment==== Here is the pseudocode for my program: Start FantasyFootball QB = Quarterback WR1 = Wide Receiver 1 WR2 = Wide Receiver 2 RB1 = Running Back 1 RB2 = Running Back 2 TE = Tight End K = Kicker function QB QByards = yardsPassing() + yardsRushing() + yardsReceiving() QBtouchdowns = touchdownsPassing() + touchdownsRushing() + touchdownsReceiving() QBturnovers = interceptions() + fumbles() index = 0 QB{0} = mod(QByards, 10) QB{1} = QBtouchdowns x 6 QB{2} = QBturnovers x 2 pointsQB = QB{0} + QB{1} - QB{2} end function function RB RB1yards() = yardsRB1( rushing + receiving + passing) RB1touchdowns() = touchdownsRB1( rushing + receiving + passing) RB1turnovers() = turnoversRB1(interceptions + fumbles) RB2yards() = yardsRB2(rushing + receiving + passing) RB2touchdowns() = touchdownsRB2(rushing + receiving + passing) RB2turnovers() = turnoversRB2(interceptions + fumbles) index = 0 RB1{0} = mod(RB1yards(), 10) RB1{1} = RB1touchdowns() x 6 RB1{2} = RB1turnovers() x 2 RB2{0} = mod(RB2yards(), 10) RB2{1} = RB2touchdowns() x 6 RB2{2} = RB2turnovers() x 2 pointsRB1 = RB1{0} + RB1{1} - RB1{2} pointsRB2 = RB2{0} + RB2{1} - RB2{2} pointsRBs = pointsRB1 + pointsRB2 end function function WR WR1yards() = yardsWR1(receiving + rushing + passing) WR1touchdowns() = touchdownsWR1(receiving touchdowns + rushing touchdowns + passing touchdowns) WR1turnovers() = turnoversWR1(interceptions + fumbles) WR2yards() = yardsWR2(receiving + rushing + passing) WR2touchdowns() = touchdownsWR2(receiving + rushing + passing) WR2turnovers() = turnoversWR2( interceptions + fumbles) index = 0 WR1{0} = mod(WR1yards() , 10) WR1{1} = WR1touchdowns() x 6 WR1{2} = WR1turnovers() x 2 WR2{0} = mod(WR2yards() , 10) WR2{1} = WR2touchdowns() x 6 WR2{2} = WR2turnovers() x 2 pointsWR1 = WR1{0} + WR1{1} - WR1{2} pointsWR2 = WR2{0} + WR2{1} - WR2{2} pointsWRs = pointsWR1 + pointsWR2 end function function TE TEyards() = yardsTE(receiving + rushing + passing) TEtouchdowns() = touchdownsTE(receiving + rushing + passing) TEturnovers() = turnoversTE(interceptions + fumbles) index = 0 TE{0} = mod(TEyards() , 10) TE{1} = TEtouchdowns() x 6 TE{2} = TEturnovers() x 2 pointsTE = TE{0} + TE{1} - {TE2} end function function K KfieldGoals() = field goals made x 3 KextraPoints() = extra points made x 1 pointsK = KfieldGoals() + KextraPoints() end function index = 0 Points{0} = pointsQB Points{1} = pointsRBs Points{2} = pointsWRs Points{3} = pointsTE Points{4} = pointsK totalPoints = Points{0} + Points{1} + Points{2} + Points{3} + Points{4} ====Data==== Unfortunately, I was unable to get the experiment beyond pseudocode stage. ====Analysis==== N/A. Unable to complete experiment. ====Conclusions==== My conclusion is that I am biting off more than I can chew with attempting to complete a full program. I am sure there are functions that can be written and loop through each position.