Here is a chance to improve your grade for MAE-10. The number of points extra that you get are not yet determined. But the harder the problem you solve the more points that you get. I have estimated the difficulty of the problems and posted it for your guidance.

If you are working in one of the problems, and you believe that you would solve one (or all of them), you must let me know during week 5 (and discuss your approach with me) in order to get the benefits. If you try the problems, it will be a fun way to get practice in programming. However, no "partial" credit will be given for these problems.

Fall 2006 EXTRA CREDIT

Problem 1

Difficulty: Moderate

Chess problem. Input: the initial location of a white knight and the type and location of an enemy black piece. Output: the maximum number of knights that can be placed that are not attacking each other and that cannot be attacked by the enemy piece. Also, the location of such knights. Note: the knights can be attacking the enemy piece.

Winter 2006 EXTRA CREDIT

Problem 1

Difficulty: Moderate

Chess Problem. The user inputs the starting location of a white King anywhere on the board. Your program must then calculate the total number of pathways the King may take in order to reach each of the other 63 squares. The pathways must be the shortest pathways possible. For example, if the King is placed in bottom-left corner of the board, there is only one pathway to each of the surrounding spaces. However, there are two pathways the King may take to arrive two spaces above its initial position. Your output should look like the following:
(5 more rows)
2 2 1 (5 more columns)
1 1 2 (5 more columns)
K 1 2 (5 more columns)
where (5 more columns) means I have omitted the data for those columns. You must print out the results for all positions on the board (print out 64 items to the screen).
You can check out the rules here.

For a description of the official chess notation to use see here

Problem 2

Difficulty: Moderate/Challenging


Chess problem. This problem is similar to problem 1 but with one addition. The user inputs both the initial position of a white King and a black piece of the user's choosing. Your program must then calculate the total number of pathways the King may take in order to reach each of the other 63 squares (if it can). The pathways must be the shortest pathways possible.

Fall 2005 EXTRA CREDIT

Problem 1

Difficulty: Moderate

Design a very basic poker program. Start by giving yourself and your opponent N amount of chips.
First, you and your opponent must put an 'ante' into the pot. An ante is a small forced bet (say, $1 if you have $100 initially) to make sure there is action in the hand. You and your opponent are then dealt 5 cards. If you like your hand, you can bet X amount of chips and then have the option of 'drawing' more cards. Drawing means that you discard Q number of cards (between 1-5) and then refill your hand by taking Q number of cards from the deck. If you love your hand, you may pass on your option to draw. If you hate your hand, you can fold and move on to the next hand. Assume that your opponent loves his hand, calls your bet and does not draw.
To make your life easier, you can assume that you are using an infinite deck. That is, if you are dealt the Jack of clubs, you do not need to worry about removing that card from your Fortran deck (there may be a hand where you have more than one Jack of clubs). You can then bet again after you receive your new cards. You opponent will call this bet. Now comes the showdown. Whoever has the best hand will win the pot. If you both have the same hand, you split the pot. The ranking of hands can be found here. Then the next hand will be dealt.

Problem 2

Difficulty: Moderate/Challenging

Chess Problem. (description given here soon)

Winter 2005 EXTRA CREDIT

Problem 1

Difficulty: Moderate/Challenging

The knight problem. Write a FORTRAN program that will take as input two different squares in the chess board. It must use chess notation. The objective is to find ALL the paths that a knight can take from one square to the other in the MINIMUM number of moves. Namely, the program should output the number of possible solutions, and the paths themselves also.

Problem 2

Difficulty: Moderate

The queen problem. Write a FORTRAN program that will take as input the location of ONE square in the chess board. It must use chess notation. In that location, a chess queen is to be placed. The objective of the program is to find the location (squares) in the chess board where 7 additional queens can be placed. The catch is that none of the queens should be able to "take" each other.

2004 EXTRA CREDIT

Problem 1

Difficulty: Challenging

Write a FORTRAN program that plays Blackjack. Use a random number generator to deal the cards. The program plays the dealer against a user. The user has 1000 chips to bet at the start of the game. Maximum bet allowed is 100 chips. The program does NOT have to support the split hand (double bet).

2003 EXTRA CREDIT

Problem 1

Difficulty: Easy/Moderate

Write FORTRAN program that reads two 20-digits integers from a file. It prints their product and their sum. Hint: use arrays to store the integers.

Problem 2

Difficulty: Challenging

Write a program that reads the position of the pieces of a given chess position. It should output ALL the legal moves that the Black pieces have. In order to make it simpler, we will ignore "en passant" and castling. If you don't know how to play chess, it is easy to learn (it is one of those games that it is very easy to learn but very hard to master). You can check out the rules here.

QUESTION: I have a good idea how to approach the second extra credit... but how to I draw (or simulate) a chess board? Should I just use the whole PieceLetterNumber (BA4, KF8, etc.)? And if so, what is the official notation for that? Knights and Kings start with the same letters, and are the rows/columns labeled with respect to white or black?

For a description of the official chess notation to use see here

Problem 3

Difficulty: For genius only

Write a program to read a position of the following 4 chess pieces: White King, Black King, and the two Black Bishops (one in light squares and the other in dark squares). Write a program where the computer plays the Black pieces and the user plays the White pieces. The computer must be able to checkmate the opponent in less than 50 moves. WARNING: This is not an easy problem. It is addictive. Once I started writing it, I found myself unable to leave my room until it was completed. HINT: Click here

2002 EXTRA CREDIT

Problem 1

Difficulty: Easy

Write a program that prints itself. This is an easy program to write. In order to make it interesting, you must use as few characters as you can. The person who uses the smallest number of characters will be given credit only. Remember that spaces count as characters. You are not allowed to ask questions to anyone including the T.A.'s of the course. If you have questions regarding the problem you can discuss them only with me. Problem is due any time before the first 10 minutes of the last lecture.

Problem 2

Difficulty: Challenging

Write a FORTRAN program to play a rook ending in chess. The computer plays white. The user plays black. The computer has ONE rook and a king. The user has only a king. First the program should ask for the position of the 3 pieces (1 white rook, 1 white king, 1 black king). Second, the program should ask black to move. Third, the program should output white's move. Repeat the last two step until check mate is achieved. The program should check mate black in less than 35 moves. Use algebraic notation to communicate with the user. For a tutorial on algebraic notation see http://www.uschess.org/beginners/read/. If the program stale mates you are not given any credit.

Problem 3

Difficulty: Moderate

I have always wondered if my phone number appears somewhere in the decimals of Pi. In order to explore this question you are asked to: (1) get a data file with the first one million digits of Pi from some place in the internet. Save it to your computer. (2) Write a FORTRAN program that reads a 7 digit number, searches the data, and outputs if the number was found and in what position. This could be a typical run of the program:
Enter a 7-digit number: 8246126

The number 8246126 was found.
Position = 3411465 
counting from the first digit after the decimal point. 
The 3. is not counted. 

The string and surrounding digits:
89623708062793377440 8246126 98241081354029969719 

A word of caution... most likely the file that you will get has several lines. Keep in mind that the number that you are looking for might be broken by the newline. For example, if your file has:
3.1415926535897932384626433832795028841971693993751058209749445923078164062862
089986280348253421170679821480865132823066470938446095505822317253594081284811
174502841027019385211055596446229489549303819644288109756659334461284756482337
867831652712019091456485669234603486104543266482133936072602491412737245870066
The number 2862089 is between line 1 and line 2. The number 8620899 is also between line 1 and line 2. The number 7867831 is found between line 3 and line 4.... you get the idea.

Final note, the file that I have contains the first 100,000,000 digits of Pi. For the sake of this problem, the first 1 million digits should suffice.

2001 EXTRA CREDIT

Problem 1

Difficulty: Very Challenging

Decode the following secret message. You are allowed to write as many computer programs as you need to in order to accomplish your task. You are allowed to read as many books as you wish and to work individually or in groups of two. You are not allowed to ask questions to anyone including the T.A.'s of the course. Problem is due any time before the final exam. You must present your solution and all the code that you wrote to solve the problem.

xxXy91XX2422XyXX69yyYy9978Xy1316xYXyYY6716yyyy24Xy16XX242491XX23YYXyXX9978Xy24yyyy22 XX13Xy1316xYXy95xYyy9524xY. XyxxXy24yyyy22XyXX13Xy1316xYXy13xYXX6716xY69YYXyXX9978 91yy9978xY69Xy911623Xy1316xY23XyXX69xYXy16xY69xY. Xyxx12Xy1316xY23Xy24xx22xYXy1316xYxx69 20yy47YY. Xyyy69XyYyYY. XyXX9978XyxxXy91yy9978xY69Xy16yy91XyYY96XX6913Xy1316xY23 91xY69xYXy9116xY99Xy1316xY23Xy91xY69xYXy12xx1213xYxY99. Xy99yy13Xyxx99XyXXXy96xYXX99 91XX23. Xyxx99XyXXXy67Yy69xxyyYyYYXy91XX23. Xyxx13XyxxYYXy24xx22xYXy24yyyy22xx9914XyXX13 XX2424Xy1316xYXyYY13Yy78xY9913YYXyXX9978Xy91yy9978xY69xx9914Xy9116yyXy16XX78 1316xYxx69Xy16xYXX6913Xy4769yy22xY99Xy1316XX13Xy78XX23, XyXX9978Xy16yy91Xy1316xY23 XX69xYXyXX4724xYXy13yyXy67yy95xYXy91xx1316Xy16XX71xx9914Xy131669xYxYXy97Yyxx2525xYYY XX9978XyXXXy47yyyy22Xy69xY95yy6913Xy78YyxYXyyy99Xy13yy95Xyyy12Xy1316XX13. Xyyy69 91yy9978xY69xx9914Xy9116yyXy78xx78Xy1316xYXy16xYXX6913Xy4769xYXX22xx9914. XX9978Xy91yy9978xY69xx9914Xy911623.

Problem 2

Difficulty: Challenging

Write a FORTRAN program to play a rook ending in chess. The computer plays white. The user plays black. The computer has two rooks and a king. The user has only a king. First the program should ask for the position of the 4 pieces (2 white rooks, 1 white king, 1 black king). Second, the program should ask black to move. Third, the program should output white's move. Repeat the last two step until check mate is achieved. The program should check mate black in less than 35 moves. Use algebraic notation to communicate with the user. For a tutorial on algebraic notation see http://www.uschess.org/beginners/read/

Problem 3

Difficulty: Moderate

Solve the following three problems from the book: Chapter 8, Problem 17 and 18. Chapter 9, Problem 10.

2000 EXTRA CREDIT

Problem 1

Difficulty: Very Challenging

Decode the following secret message. You are allowed to write as many computer programs as you need to in order to accomplish your task. You are allowed to read as many books as you wish and to work individually or in groups of two. You are not allowed to ask questions to anyone including the T.A.'s of the course. Problem is due any time before the end of last lecture. You must present your solution and all the code that you wrote to solve the problem.

9110171099 018267214189110 02393159911102412 0919313 01393 07410
931316109919181110 013167291 019167213 01813 02618141613 0729595107299 01393
931316109911 013167213 0239315 019109910 09399 02618141613 016721710
74101091 0919313 0931316109919181110 013167291 019167213 0239315 0167278
74101091 01993152478 016721710 07295951072991078 01393 013161026 01393 07410
931316109919181110

2410191811 076729999932424

 

Suggested reading material (all available in Amazon.com)

How to Write and Decode Secret Messages (Codemaster , No 1) by Marvin Miller, Jim Frazier (Illustrator)

Cryptanalysis a Study of Ciphers and Their Solutions
by Helen Fouche Gaines

You can check our local library for any books on cipher decoding.

 

Problem 2

Difficulty: Very Challenging

Write a FORTRAN program that will take as input the position of a knight on a chessboard. As output, the program should print out the next 63 moves of the knight so that it never moves to the same square more than one time.