Lab 11: Pair Programming. Review: Pair Programming Roles

Similar documents
Text UI. Data Store Ø Example of a backend to a real Could add a different user interface. Good judgment comes from experience

Designing a Social Network Prep for Lab 10. March 26, 2018 Sprenkle - CSCI Why classes and objects? How do we create new data types?

Review of Lab 9. Review Lab 9. Social Network Classes/Driver Data. Lab 10 Design

Objec&ves. Usability Project Discussion. May 9, 2016 Sprenkle - CSCI335 1

Chapter 11. Weighted Voting Systems. For All Practical Purposes: Effective Teaching

Election Night Results Guide

CSCI211: Intro Objectives

IBM Cognos Open Mic Cognos Analytics 11 Part nd June, IBM Corporation

Clarity General Ledger Year-end Procedure Guide 2018

Analyzing proofs Introduction to problem solving. Wiki: Everyone log in okay? Decide on either using a blog or wiki-style journal?

11/15/13. Objectives. Review. Our Screen Saver Dependencies. Our Screen Saver Dependencies. Project Deliverables Timeline TEAM FINAL PROJECT

Summary This guide explains the general concepts regarding the use of the e- Nominations website Version 3.1 Date 07/02/ e-nominations...

1 e-nominations Parts of e-nominations Basic Principles The e-nominations homepage Global Position...

In your Interactive Notebook: Unit 2 - Lesson 4 The Federal Executive Branch

Coverage tools Eclipse Debugger Object-oriented Design Principles. Oct 26, 2016 Sprenkle - CSCI209 1

Working the Bump List

State Instructions Online Taxability Matrix and Certificate of Compliance

One View Watchlists Implementation Guide Release 9.2

Legislative Counsel Bureau Information Technology Services. NELIS Nevada Electronic Legislative Information System

Deficiencies in the Internet Mass Media. Visualization of U.S. Election Results

Objec&ves. Review. JUnit Coverage Collabora&on

City of Toronto Election Services Internet Voting for Persons with Disabilities Demonstration Script December 2013

Andreas Fring. Basic Operations

Social Studies Lesson Plan Analyze how the Constitution has expanded voting rights from our nation's early history to today

Inviscid TotalABA Help

Election Inspector Training Points Booklet

Shutdown By R. J. Pineiro READ ONLINE

CS 5523: Operating Systems

Atlanta Bar Association Website User s Guide

Today s plan: Section : Plurality with Elimination Method and a second Fairness Criterion: The Monotocity Criterion.

SOE Handbook on Certifying Candidate Petitions

Thinking back to the Presidential Election in 2016, do you recall if you supported ROTATE FIRST TWO, or someone else?

PBS CQ Bidding Guide. Version July 26, 2017

Chapter 8: Recursion

Creating a Criminal Appeal and documents in ecourts Appellate

Charter Township of Canton

ELECTRONIC POLLBOOK OPERATION

Josh Engwer (TTU) Voting Methods 15 July / 49

Chapter 1: Number Concepts

Manage Subpoenas. DA IT Video Library. Supporting Documentation Facilitator: Teresa Radermacher Recorded: November 2008 Duration: 1 hour, 16 minutes

Large Group Lesson. Introduction Video This teaching time will introduce the children to what they are learning for the day.

Hoboken Public Schools. AP Calculus Curriculum

Clause Logic Service User Interface User Manual

NELIS NEVADA ELECTRONIC LEGISLATIVE INFORMATION SYSTEM 79TH (2017) SESSION

Proving correctness of Stable Matching algorithm Analyzing algorithms Asymptotic running times

JD Edwards EnterpriseOne Applications

My Health Online 2017 Website Update Online Appointments User Guide

Tariffs and Tariff Comparison

Hoboken Public Schools. Physical Education Curriculum

Voting Protocol. Bekir Arslan November 15, 2008

Modeling confrontations using Options Boards

The Electoral College

SCHOOLMASTER. Appointment Scheduling. Student Information Systems. Revised - August Schoolmaster is SIF Certified

Inviscid TotalABA Help

User guide to main functions July 2007

Navigating the South Dakota Legislature website

International Orientation

Substantial rewording of Rule 1S follows. See Florida Administrative Code for present text.

Navigating the South Dakota Legislature website

SOE Handbook on Certifying Candidate Petitions

Hoboken Public Schools. PLTW Introduction to Computer Science Curriculum

DevOps Course Content

Guernsey Chamber of Commerce. Website User Guide

Case 1:17-cv Document 1 Filed 12/11/17 Page 1 of 28 PageID #: 1

Dispute Resolution and De-Enroll Report Tutorial May 20, 2014

2016 FALL SEASON Parent Meeting for 2008 Players

Check off these skills when you feel that you have mastered them. Identify if a dictator exists in a given weighted voting system.

BMI for everyone. Compsci 6/101: PFTW. Accumulating a value. How to solve an APT. Review how APTs and Python work, run

Case 1:17-cv Document 1 Filed 10/23/17 Page 1 of 24

Poll Worker Training Questions

This manual represents a print version of the Online Filing Help.

1. Title: Group and Individual Actions of Citizens that Demonstrate Civility, Cooperation, Volunteerism, and other Civic Virtues

Political Science 381: The Politics of Electoral Systems. Course Description

representative of a class of similarly situated

Refugee Crisis. Eric Hagen Rob Kuvinka Reema Naqvi

2017 Arkansas Press Association Better Newspaper Editorial Contest Rules & Categories

Discourse Obligations in Dialogue Processing. Traum and Allen Anubha Kothari Meaning Machines, 10/13/04. Main Question

Program Management Reports Guide

VOTING DYNAMICS IN INNOVATION SYSTEMS

Stock Show Online Nomination Process Step-by-Step Instructions

Tuesday November 29, 2016

FM Legacy Converter User Guide

MIS 0855 Data Science (Section 005) Fall 2016 In-Class Exercise (Week 12) Integrating Datasets

The Seniority Info report window combines three seniority reports with an employee selection screen.

PA 372 Comparative and International Administration

Mojdeh Nikdel Patty George

Frequently Asked Questions

6/7/2018. KSWebIZ What s New? Summary. Objective

PRINT an answer sheet (page 4).

Yearbook Pacing Guide

CivCity Voting Issue Fall Please feel free to contact us with any questions or for additional information:

American National Government Spring 2008 PLS

How to Complete UNT Incoming Exchange Student Application

Blog Manager. Features. Admin Management. Webkul Blog. webkul.com /blog/magento-blog-manager/

Small Claims Court. A Guide for Claimants, Defendants & Third Parties

Chapter 12, Section 2 Independence for Texas

Troubleshooting Manual

Sage 100 Fund Accounting. Bank Reconciliation STUDENT WORKBOOK SAGE LEARNING SERVICES. Important Notice:

Objec&ves. Review. So-ware Quality Metrics Sta&c Analysis Tools Refactoring for Extensibility

Voter Services Judge Training. Carla Wyckoff Lake County Clerk LakeCountyClerk.info

Transcription:

Lab 11: Pair Programming Apr 2, 2019 Sprenkle - CSCI111 1 Review: Pair Programming Roles Driver (Like the role I play when we write programs in class) Uses keyboard and mouse to execute all actions on the computer Ask questions wherever there is a lack of clarity Offer alternative solutions if you disagree with the navigator Ø When there is disagreement, defer to the navigator. If idea fails, get to failure quickly and move on Make sure code is clean Explains actions taken Brainstorms Navigator (Like the role you play when we write programs in class) Directs driver s actions Ø Dictates the code that is to be written - the what Ø Clearly communicates what code to write Explains why chose particular solution to this problem Checks for errors and typos Plans the problem solving or debugging actions Asks questions Switch roles at the beep Apr 2, 2019 Sprenkle - CSCI111 2 1

Lab 11 Directory Your directory should look like (to start) Ø connectfour.py Ø csplot.py Ø facespace.py facespace.out Ø person.py person.out Ø social.py social.out Ø test.py Apr 2, 2019 Sprenkle - CSCI111 3 Reviewing Lab 10 Text UI Created two classes Ø Used one class within another class Ø Tested them Graphical UI Backend Data Store (files) Ø Example of a backend to a real application Could add a different user interface Good judgment comes from experience Ø Test methods after writing method Ø Remember your data types Ø Refer to the data type s API What could you do to improve your development process? Apr 2, 2019 Sprenkle - CSCI111 4 2

Lab 10 Feedback Problem solving capstone! Ø Solving lots of different small problems in a variety of ways Use methods you ve already written Ø Example: use addperson in addpeople Ø Who has this functionality? Do I have access to that object in this method? Adhere to interface Ø Accepted parameter types Ø Type of what is returned Apr 2, 2019 Sprenkle - CSCI111 5 Lab 11: Three Parts Linux practice: Ø Using the wc command Social Network extensions Ø Binary search find people with a certain name Ø UI: add search functionality Two-dimensional lists Ø Including Connect Four Apr 2, 2019 Sprenkle - CSCI111 6 3

wc Command wc: Word Count Ø Counts the lines of Social Network code from Lab 10 Ø Compare with code for this assignment Example: Ø wc l../lab10/*.py Specific directions are in the lab Apr 2, 2019 Sprenkle - CSCI111 7 Social Network, Extended Searching Overview Ø Allows you to search for people by their name lowercased for more intuitive results Ø Update Person and SocialNetwork classes and UI appropriately Specific directions are in the lab Apr 2, 2019 Sprenkle - CSCI111 8 4

Consider what happens when Extensions to Solutionsearchlist is a list of Persons, key is a str def search(searchlist, key): representing a name low=0 Goal: return a Person object with high = len(searchlist)-1 that name (key) while low <= high : mid = (low+high)//2 if searchlist[mid] == key: return mid elif key > searchlist[mid]: # look in upper half low = mid+1 else: # look in lower half high = mid-1 return -1 0 1 2 3 4 Person Person Person Person Person Id: 4 Id: 3 Id: 1 Id: 5 Id: 2 Apr 2, 2019 Sprenkle Ben - CSCI111 Chadwick Gal Samuel Scarlett 9 Summary of Modifications to Binary Search Add a search method Ø Takes as parameter the name to search for Need to lowercase that name for more intuitive results Ø Original binary search function took a list as a parameter; our method does not Where should we get our list to search? Check the name of the Person that is at the midpoint, lowercased If we have a match, return that Person Represent (in method) and handle (in UI) when no person has that name Apr 2, 2019 Sprenkle - CSCI111 10 5

SocialNetwork Code Fix the major problems in your code first Or, use the code in the handouts/lab10_solution directory Ø person.py, social.py, facespace.py Apr 2, 2019 Sprenkle - CSCI111 11 2D LISTS Apr 2, 2019 Sprenkle - CSCI111 12 6

Review How do you create a 2D list? How do you get the 2 nd element in the 3 rd row of a list? How do you find the number of lists in a 2D list? How do you find the number of elements in one of those lists? Apr 2, 2019 Sprenkle - CSCI111 13 Handling Rectangular Lists 2-d list var Row pos Col pos twod[1][2] = 42 list twod list twod[0] twod[0][0] Assignment list twod[1] 42 list twod[2] twod[2][3] What does each component of twod[1][2] mean? How many rows does twod have, in general? Ø rows = len(twod) How many columns does twod have, in general? Ø cols = len(twod[0]) Apr 2, 2019 Sprenkle - CSCI111 14 7

Game Board for Connect Four 6 rows, 7 columns board Players alternate dropping red/black checker into slot/column Player wins when have four checkers in a row vertically, horizontally, or diagonally How do we represent the board as a 2D list, using a graphical representation? Apr 2, 2019 Sprenkle - CSCI111 15 Game Board for Connect Four How to represent board in 2D list, using graphical representation? Number Meaning Color 0 Free Yellow 1 Player 1 Red 2 Player 2 Black Row 5 Row 0 Apr 2, 2019 Sprenkle - CSCI111 16 8

Connect Four (C4): Making moves User clicks on a column Ø Checker is filled in at that column # gets the column of where user clicked col = csplot.sqinput() Apr 2, 2019 Sprenkle - CSCI111 17 ConnectFour Class Play the game method implementation Ø Repeat: Get input/move from user Check if valid move Make move Display board Check if win Change player won = False player = ConnectFour.PLAYER1 while not won: print("player {:d}'s move".format(player)) if player == ConnectFour.PLAYER1: col = self._usermakemove() else: # computer is player 2 # pause because otherwise move happens too # quickly and looks like an error sleep(.75) col = self._computermakemove() row = self.makemove(player, col) self.showboard() won = self._iswon(row, col) # alternate players player = player % 2 + 1 Apr 2, 2019 Sprenkle - CSCI111 18 9

Problem: C4 - Making a Move The player clicks on a column, meaning that s where the player wants to put a checker How do we update the board? Apr 2, 2019 Sprenkle - CSCI111 19 Looking Ahead Bring your final exam envelopes to me by Friday Ø Exam will be taken in Parmly 405 Bring your final exam questions Friday Thanks to Hammad, Alyssa, and Rinn for their help this semester! Apr 2, 2019 Sprenkle - CSCI111 20 10