View the step-by-step solution to:

CMSC 201 Spring 2016 Project 2 - Recursive Word Search Assignment: Project 2 - Recursive Word Search Due Date: Wednesday, May 4th, 2016 by 8:59 PM...

Python3 / I will attach a couple of folders and files one has the coding standards and one has the project that the you should do. Also when you open the project you will see that the instructor talks about a couple of files they are also attached, Please follow the instructions and make sure the codes do not contain any plagiarism or similarity from anyone else , even if the code was ordered here.

CMSC 201 – Computer Science I for Majors Page 1 CMSC 201 Spring 2016 Project 2 – Recursive Word Search Assignment: Project 2 – Recursive Word Search Due Date: Wednesday, May 4th, 2016 by 8:59:59 PM Value: 80 points Project 2 is the second and final project assignment in CMSC 201. As in Project 1, you will get the chance to make your own decisions about how you want your program to handle things, what its functions should be called, and how you want to go about designing it. Project 2 will also be substantially longer than any of the single homework assignments you’ve completed so far, so make sure to take the time to plan ahead, and don’t do any “cowboy” coding! Remember to enable Python 3 before you run your programs: scl enable python33 bash Instructions For this assignment, you'll need to follow the class coding standards , a set of rules designed to make your code clear and readable. The class coding standards are on Blackboard under “Course Documents” in a file titled “CMSC 201 - Python Coding Standards.” You should be commenting your code, and using constants in your code (not magic numbers or strings). You should also have a function header comment for every function that is not main() ! Re-read the coding standards! You will lose major points if you do not following the 201 coding standards. A very important piece of following the coding standards is writing a complete file header comment block . Make sure that your file has a comment block at the top (see the coding standards document for an example). NOTE: Your filename for this project must be proj2.py NOTE: You must use main() in your file.
Background image of page 1
CMSC 201 – Computer Science I for Majors Page 2 Details The purpose of this assignment is to give you practice with recursion, using two-dimensional lists, and to do some file handling where it's necessary to detect the end of the file or end of the list. You'll also be getting some experience with using datasets of a variable size. As always, you should continue to practice detailed project design (prior to coding!) and good implementation techniques like incremental programming. A popular form of puzzle is known as the "word search". Besides being good entertainment when waiting at the airport or at the doctor's office, this type of puzzle is often used to help young children build vocabulary and practice spelling. A word search is a 2-dimensional grid or matrix of letters which contains "hidden words". The person working the puzzle is given a list of words that are hidden in the matrix and is asked to locate and circle them. The fun part is that the words may appear horizontally, vertically or diagonally in the grid. Horizontal words may be written left-to-right or right-to-left. Vertically oriented words may be written top-down or bottom-up. Similarly for diagonally oriented words. Puzzles will be any size but they will always be rectangular. Here's a simple word search puzzle for you. (The grid below is 12 x 12.) G J T P B A V K U V L V M N Q H S G M N T C E E Y H I J S G Q E N Y C W G S K M G H C B M U T H R A T V M N V D G V U T E P G U E A B P W Q R T T J C I D D R Q T E E C U P C I S E N G B U O B P S J C I V N F O U N N M P R O J E C T R R A M O H Q T P P D S H A P G C O W U K Q E G I J M S
Background image of page 2
Show entire document
CMSC 201 – Computer Science I for Majors Page 1 CMSC 201 Spring 2016 Python Coding Standards Every programming department has a set of standards or conventions that programmers are expected to follow. The purpose of these standards is make programs readable and maintainable. After all, you may be the programmer who maintains your own code more than 6 months after having written the original. Programming standards vary by department; therefore, it is important that all members of the department follow the same standards. Neatness counts! At UMBC, the following standards have been created and are followed in CMSC 201. Part of every project and homework grade is how well these standards are followed. It is your responsibility to understand these standards. If you have questions, ask any of the TAs or the instructors. Naming Conventions Use meaningful variable names!! o For example, if your program needs a variable to represent the radius of a circle, call it radius , not r and not rad . o The use of obvious, common, meaningful abbreviations is permitted. For example, ‘number’ can be abbreviated as num as in numStudents . o The use of single letter variables is forbidden except in loops. Begin variable and function names with lowercase letters. Names of constants should be in all caps with underscores between words. o e.g. , EURO_TO_USD = 1.13 or MAX_NUM_STUDENTS = 100 Separate "words" within identifiers with underscores or mixed upper and lowercase. o e.g. , grandTotal or grand_total o Be consistent! If you choose to use mixed case (also known as “camel case”), always use mixed case. o Do not use global variables!
Background image of page 1
CMSC 201 – Computer Science I for Majors Page 2 Use of Whitespace The prudent use of whitespace goes a long way to making your program readable. Horizontal whitespace (spaces between characters) will make it easier to read your code. Vertical whitespace (blank lines between lines of code) will help you to organize it. Use blank lines to separate major parts of a program. Indentation should be 4 spaces long. Using Tab in emacs will accomplish this. Use spaces around all operators. o For example, write x = y + 5 , NOT x=y+5 . Use of Constants To improve readability, you should use constants whenever you are dealing with hard- coded values. Your code shouldn't have any "magic numbers," numbers whose meaning is unknown. For example: total = subtotal + subtotal * .06 In the code above, .06 is a magic number. What is it? The number itself tells us nothing; at the very least, this code would require a comment. However, if we use a constant, the number's meaning becomes obvious, the code becomes more readable, and no comment is required. Constants are typically placed near the top of the program so that if their value ever changes they are easy to locate to modify. Constants may be placed outside of the main() function – this makes them global constants, which means everything in the file has access to them. (Global variables are only allowed for constants!) Here’s the updated code: TAX_RATE = .06 # TAX_RATE is a global constant def main(): # lots of code goes here total = subtotal + subtotal * TAX_RATE # other code goes here print("Maryland has a sales tax rate of", TAX_RATE, "percent") main()
Background image of page 2
Show entire document
CORGI DALMATIAN HUSKY RETRIEVER SHEEPDOG CHIHUAHUA LABRADOR
Background image of page 1
R N S G C X D F E M H N J A A R V H E M T N L Y E F E W P I M R I M P U G T A P R O D R E D T H T I O O B M I D E C G I M D A P R H U S K Y N V
Background image of page 1
G J T P B A V K U V L V M N Q H S G M N T C E E Y H I J S G Q E N Y C W G S K M G H C B M U T H R A T V M N V D G V U T E P G U E A B P W Q R T T J C I D D R Q T E E C U P C I S E N G B U O B P S J C I V N F O U N N M P R O J E C T R R A M O H Q T P P D S H A P G C O W U K Q E G I J M S
Background image of page 1
GRACE HOPPER ALAN TURING LARRY PAGE SERGEY BRIN ADA LOVELACE TIM BERNERSLEE EDSGER DIJKSTRA DONALD KNUTH BARBARA LISKOV CAPTAIN CRUNCH
Background image of page 1
E U H Q D M Z E Z K C E N O E L C Z K N A Y L I P A A R L U L R A S R P V N A T E R D G R B E R O H V E A M M E T R A D O G Z I E S N L B R L S T X K L A R R Y T D F J R N V R E S U E I M J J H Y E B R D B A R B A R A D I A B W W J G J F Q N A T C S E Q P V F G M K T Y E G A P U B V O K S I L X R T
Background image of page 1
COMPUTER SCRAM COURSE LECTURE PROGRAMMING PROJECT SCIENCE STUDENT UMBC
Background image of page 1
Sign up to view the entire interaction

Top Answer

Please find the solution attached And remove blank white spaces lines from... View the full answer

p.txt

G J T P B A V K U V L V
M N Q H S G M N T C E E
Y H I J S G Q E N Y C W
G S K M G H C B M U T H
R A T V M N V D G V U T
E P G U E A B P W Q R T
T J C I D D R Q T E E C
U P C I S E N G B U O B
P S J...

w.txt

COMPUTER
SCRAM
COURSE
LECTURE
PROGRAMMING
PROJECT
SCIENCE
STUDENT
UMBC

wordSearch.py

direction = "";
#function to propogate in some direction
def checkDir(matrix,word,row,col,index,n,m):
global direction
if goLeft(matrix,word,row,col,index,n,m):
direction = "goes...

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online