- This topic has 13 replies, 7 voices, and was last updated 17 years, 6 months ago by
MajorMajorMajor.
-
AuthorPosts
-
April 27, 2009 at 2:13 am #7403
YahooEarth
ParticipantI’m sure for all the pros out there this code will be simple nub work, but if anyone wants to help me out and write a lil for me…I have a few problems!
All the code would be in c++ btw…
p.s. This is all extra credit work, and our teacher does not care about getting the code from the internet, he just wants us to get it…
____________________________________________________
Searching a Maze
Pattern matching and search, common to Artificial Intelligence,
are represented by the following problem. Suppose there exists a
12 x 12 array containing blanks and X’s. The X’s represent blocked
positions and the blanks are open positions. Starting at 0,0 you are
to find a list of positions that will take you to position n,m
where n is maximum row index and m is the maximum column index,
(recall C starts out at 0). You can only move to an open position
that is immediately above, below, left or right. No moving on the
diagonal. For example:
– – – – – – – – – – – –
| |X| | |X| | | | |X| | |
– – – – – – – – – – – –
| | | | | | |X|X|X| |X| |
– – – – – – – – – – – –
| |X| | | |X| | | |X| | |
– – – – – – – – – – – –
| | |X| | | | |X| | |X| |
– – – – – – – – – – – –
| |X|X|X|X| |X| | |X| | |
– – – – – – – – – – – –
| |X| | | | | | |X| | | |
– – – – – – – – – – – –
| |X| | |X|X| |X| | |X| |
– – – – – – – – – – – –
| |X|X| |X| | |X| |X|X| |
– – – – – – – – – – – –
| |X| |X| | |X| | |X| | |
– – – – – – – – – – – –
|X| | | | | | | | |X| | |
– – – – – – – – – – – –
| | | |X|X|X| | | | |X| |
– – – – – – – – – – – –
| |X| |X|X|X|X| | |X| | |
– – – – – – – – – – – –
would have solution:
0,0 1,0 1,1 1,2 1,3 2,3 3,3 3,4 3,5 4,5 5,5 5,6
6,6 7,6 7,5 8,5 8,4 9,4 9,5 9,6 9,7 9,8 8,8 7,8
6,8 6,9 5,9 5,10 5,11 6,11 7,11 8,11 9,11 10,11 11,11
You are to write a **recursive** function that will find the path through
the maze. Include the function in a program and test using various
size mazes. You are always seeking a path from the upper left
hand corner to the lower right hand corner.
The data file indicating the maze will be given as a command line
argument and will contain data in the following manner:
4 5
bXbXb
bbXbb
XXbbb
XXXbb
where the 4 indicates the number of rows in the maze and the 5
indicates the number of columns followed by the appropriate listing
of b’s and X’s where a b indicates a blank or open position and an
X is a filled or blocked position. Your function should work on
any size maze.
__________________________________________________
Assume the existence of two sorted files. You are to write a function which
will have as its arguments the names of three files, the two sorted files and
a third file which is to be the merge of the two original files. The third
file is to be in order and is to contain all of the contents of the first
two files. Since the first two files are already in order the third in order
file may be produced without additional sorting. Moreover, the third file
may be produced without using a single array! You will read an element from
the first file, read an element of the second file, and write the smaller
of the two elements to the third file, then another read, another write, etc.
Thus, you may have no more than two elements from the files in memory at
any one time.
_______________________________________________________
Sudoku puzzle
Write a program which will produce a solution to the
Sudoku problem. Test your program on one or more of
the Sudoku puzzles found daily in the San Antonio
Express News. Your solution must solve these puzzles
for you to get credit.
Points will be given for the solution to any 4×4,
6×6, 9×9, 16×16, or any other valid size. (A 100×100
Sudoku puzzle has 10,000 entries) Solution should
be recursive.
________________________________________________________
Numerical Integration:
Look up the definition of the definite integral in your
calculus book, and write a program which will approximate
the value of a definite integral using inscribed rectangles.
Assume the interval of integration is divided into a number
of subintervals of equal length.
You should pass the interval [a,b] over which the integration
takes place, and n, the number of subintervals as command
line arguments. You may hard code the function to be
integrated. You might test your program on the integral
from 0 to 1 of f(x) = x*x since you know that the value
of this integral is 1/3.
_____________________________________________________
So yea, if anyone wants to give these a stab it would be MUCH appreciated…kthxbai!!!
< 3
April 27, 2009 at 7:28 am #82789Dankst@
Participantwhen you get the code, post it and let me check it out
i do c# and wanna check it out
April 27, 2009 at 12:04 pm #82807rainefardreamer
Participantwtf man…do your own homework
April 27, 2009 at 1:01 pm #82814YahooEarth
ParticipantITS EXTRA CREDIT!!!!
April 27, 2009 at 1:06 pm #82815MajorMajorMajor
ParticipantTL;DR
April 27, 2009 at 6:37 pm #82863MasterP
ParticipantWhen’s it due?
Read as: I might help if it’s not due in the next 2 weeks.
April 27, 2009 at 9:13 pm #82885YahooEarth
ParticipantMeh, like 1 week : (
April 28, 2009 at 12:52 am #82914MasterP
ParticipantYahooEarth said:
Meh, like 1 week : (I’ve got too much matlab code to write before graduation.
April 28, 2009 at 12:55 am #82915MajorMajorMajor
ParticipantMasterP said:
I’ve got too much matlab code to write before graduation.matlab is the worst program ever
mathematica>matlab
April 28, 2009 at 1:02 am #82919MasterP
ParticipantMajorMajorMajor said:
matlab is the worst program evermathematica>matlab
Unless you’re writing a program that disproves a good chunk of a field in physics. Mathematica doesn’t really suit my needs in that regard.
I do like Mathematica better when it comes to non-programmable math though.
April 28, 2009 at 11:08 am #82948lootool
Participantyou want fools to code for free? I hate even coding for meself…LOOT.
April 28, 2009 at 4:54 pm #83000Oh Malley
ParticipantThis is why I got my degree in Chemistry. No coding involved.
April 28, 2009 at 6:59 pm #83018YahooEarth
ParticipantI figured since I’m in principles of algorithm and design I, it would be childs play for someone more advanced to code this for me…
April 28, 2009 at 7:26 pm #83023MajorMajorMajor
Participantfor one of my roommates lab, he had to program a new microwave, with time input, heating lvl, and make the turntable spin
it was fun to play with but it took him like 50 hours lol
-
AuthorPosts
- You must be logged in to reply to this topic.