Count Mines In the following slides, I will first show an ordinary algorithm to count mines in a mine field. I will use a 3*4 board as illustration, which.

Slides:



Advertisements
Similar presentations
The Secrets of Practical Verification… © 2008 Think Verification.
Advertisements

Computer Science 313 – Advanced Programming Topics.
Program Design Divide and Conquer –Divide the program into separate tasks Functional Decomposition Top-Down Design –Divide an overall problem into discrete.
Induction (chapter of the book and chapter of the notes)
Computer Math AP Computer Science Computer Programming.
Modular Programming. Modular Programming (1/6) Modular programming  Goes hand-in-hand with stepwise refinement and incremental development  Makes the.
Project One: Creating a Complex Color Wheel. Your first project is to design and complete a complex color wheel. I am using the word COMPLEX, because.
27/05/ Iteration Loops Nested Loops & The Step Parameter.
Service System—Session One. Service System Project What to expect from this session: Overview of Service System Project Basic grasp of models and options.
SORTING ALGORITHMS King Saud University College of Applied studies and Community Service CSC 1101 By: Nada Alhirabi 1.
What do we use to measure the angle? PROTRACTOR Angles, Measuring Angles The unit of measurement of an angle is degrees. We measure angles in degrees.
Progress presentation
Dilations Dilations are what you use as a scale factor to enlarge or reduce a figure from its normal size so lets say I have a figure dimensions 3 by 6.
For RHA Executive Board Elections.  Must be 4 pages maximum (including title page)  Must have Title/cover page  Bids are due on February 13, 2013 at.
Chapter 4 Review of Software Process Models Please answer the seven Blue Questions in the following slides. Bring the answers to class on Monday June 13.
Design Pattern Introduction in Data Structures Purpose  Natural integration of patterns into data structures education Plan  Cover traditional topics.
© 2006 Pearson Education Chapter 3 Part 2 More about Strings and Conditional Statements Loops (for and while) 1.
Big-O notation.
How to develop a program
Lecture 5 of Computer Science II
Control Structure: Multiple Selections
CprE 185: Intro to Problem Solving (using C)
The Wife of Bath’s Tale The Frame.
THIS IS TO EVIDENCE YOUR WORK AND GET THE BEST GRADE POSSIBLE
Introduction Algorithms Order Analysis of Algorithm
Block 9: Assignment Briefing
continued on next slide
Similar figures are proportional
                                                                                                                                                                                                                                                
continued on next slide
continued on next slide
Clustering and randomness
Software Development Process
IC card Management System
Graph Paper Programming
Designing a Presentation
Enlargements and area Scale factor Area of object Area of image.
Joni Myres Presentation
CS 465 AES Last Updated: Sep 7, 2017.
L16: Feedback from Design Review
Final Project Description
Computer Science A Level
Test Correction Guidelines
  30 A 30 B 30 C 30 D 30 E 77 TOTALS ORIGINAL COUNT CURRENT COUNT
Agenda 10/23/15 Text Effect Project: : 2 Text Effect tutorials. See next slide. See website links for tutorials. Work on your Semester Project: 2 Photoshop.
How to develop a program
Nested Loops & The Step Parameter
I hope you all had a wonderful weekend!
Welcome to Science (2/1) Please come and see me if you would like to help pass back papers. Please have a seat and take out the following: Your “Pollen.
Dilation 8/29/30 Objective: To dilate a figure using a
АВЛИГАТАЙ ТЭМЦЭХ ҮНДЭСНИЙ ХӨТӨЛБӨР /танилцуулга/
World History Partner Multimedia Presentation Project
Top-Down Design & JSP Skill Area Part D
CS114B Introduction to Computer Science II
Transformations Translation Reflection The FRAME Routine
Agenda 11/15/17 Text Effect Project: : 2 Text Effect tutorials. See next slide. *Make sure it is a complex and completed artwork with a creative background!
Agenda 11/9/17 Text Effect Project: : 2 Text Effect tutorials. See next slide. See website links for tutorials. 2) Text Effect Scoring Guide/Grading 3)
9-6 Dilations Vocab: Dilation: A transformation that changes the size of the shape Enlargement: A dilation that makes a shape bigger (scale factor greater.
Agenda 10/27/15 Text Effect Project: : 2 Text Effect tutorials. See next slide. See website links for tutorials. Due next class Text Effects Scoring Guide.
Agenda 11/8/17 1) Text Effect Project: : 2 Text Effect tutorials. See next slide. See website links for tutorials. 2) Work on your Semester Project: 2.
Programming Assignment Tutorial
The Step Parameter & Nested For … To … Next loops
Agenda 11/4/17 Photoshop Skills to review:
continued on next slide
Synchronizers Outline motivation principles and definitions
Processing the Crime Scene
Increasing Understanding to Affect Behavior for Children with ASD
Control Structures.
Page 7 Original Expression: Step 1: Step 2: Step 3:
continued on next slide
Presentation transcript:

Count Mines In the following slides, I will first show an ordinary algorithm to count mines in a mine field. I will use a 3*4 board as illustration, which can be easily scaled up to a bigger board of any size based on the same principle. After that, I will illustrate an improved algorithm and please think carefully. CG1101 (AY2012/13 Semester 1) 1 1

Ordinary algo. to count mines #1 Case 1 (inner cell) abc'enter'def 3*4 mine board score board CG1101 (AY2012/13 Semester 1) 2 2

Ordinary algo. to count mines #2 Case 2 (boundary cell) abc'enter'def 3*4 mine board score board CG1101 (AY2012/13 Semester 1) 3 3

Ordinary algo. to count mines #3 Case 3 (corner cell) 3*4 mine board score board CG1101 (AY2012/13 Semester 1) 4 4

Enlarged 5*7 mine board with outer frame of all 0 Improved algo. illustration Enlarged 5*7 mine board with outer frame of all 0 Original 3*4 mine board CG1101 (AY2012/13 Semester 1) 5 5

Count Mines Got it? Ok, you may get the idea, then how to implement it? That’s your task  Hint: you will need to do some major change to the given skeleton if you want to apply the improved algorithm to lab#4 ex5. Overall, a better algorithm will make your program easier to write and debug. Therefore, for complex problems, spend some time to thinking about the algorithm before coding! CG1101 (AY2012/13 Semester 1) 6 6