Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters

Reply
 
Thread Tools

Please help me with program
Old 23.05.2004, 14:47   #1
Младенец
 
Join Date: 05 2004
Location: usa
Age: 80
Posts: 35
Rep Power: 0
Default Please help me with program

здраствуйте дорогие форумчане
я опять с вопросом но на этот раз поконкретнее
мне нужна программа на С
детали внизу . если кто знает как программировать пожалуйста помогите мне я буду очен благодарен.мне очен нужна это программа до 11 го июня
Project Deadline: June 11, 2004 at 17:00.

Definition
In this project your aim is to find some words in a puzzle. You will read the words and the puzzle from text files, words.txt and puzzle.txt. The dimensions of the puzzle is given in the first line of the puzzle file as first number is the row number and second is the column number. The number of words is also given in the first line of the words file. Each word has a point and a priority number, this information is also given in the words file as first the word itself, then the point, then priority, separated with blanks.You will assign the point of a word to cells that are marked for that word. If two words cross on the same cell, choose the point of the word with highe r priority. If priorities are equal,choose the higher point.
At the end of the program, you will display the characters which are not marked for any word and the total points won. Also you must report the starting row, starting column, and the directions for each word.

Sample Run
Puzzle file
3 3
cbh
bag
sat
Words file
3
ca 12 1
bag 23 2
has 5 3
Points and remaining characters for each
cell (you do not need to display it):
12 b 5
23 5 23
5 a t
Program Output:
Resulting Word is: bat
Total points: 85
Word ca is at (1,1) SE
Word bag is at (2,1) E
Word has is at (1,3) SW
Programming Details
You should keep the data for each word in a structure. The structure of a word is :
struct wordData{
char word[20];
int point;
int priority;
int row;
int column;
int direction;
}
Structure usage in this project is mandatory and note that you must use an array of structures for storing multiple wordData structures.
Since the number of words, puzzle dimensions are initially not known, all these must be dynamically allocated. You should not use static array declarations for these. You will use integers for indicating directions; the integer number for each direction is given in the following table. However, when displaying directions, you must convert these integers
to direction acronyms (NW, N, NE, …)
NW 0 N 1 NE 2
W 3 E 4
SW 5 S 6 SE 7

Sample Word Files
ALPS 01 1
ALTITUDE 02 1
ASCENT 03 1
AVALANCHE 04 1
BERGSCHRUND 05 1
BIVOUAC 06 1
BOOTS 07 1
CAMP 08 1
CHIMNEY 09 1
CLEATS 10 1
CLIMB 11 2
CLOUDS 12 2
COULOIR 13 2
CORNICE 14 2
CRAMPONS 15 2
CREVASSE 16 2
EXPEDITION 17 2
FISSURE 18 2
GEAR 19 2
GLACIER 20 2
GORGE 21 3
ICEAX 22 3
LEADER 23 3
MOUNTAIN 24 3
NEVE 25 3
OXYGEN 26 3
PACK 27 3
PEAKS 28 4
PITON 29 4
RELAY 30 4
RAPPEL 31 4
RIDGE 32 4
ROCK 33 4
ROPE 34 4
SKIS 35 4
SLOPE 36 5
SNAPRING 37 5
SNOW 38 5
SPIKES 39 5
SUMMIT 40 5
TACKLE 41 5
TEAM 42 5
WEATHER 43 5
WIND 44 5



sample puzzle files
15 15
ESSAVERCRAMPONS
RAPPELXILOSNANS
ULHEMAOPUOEKACE
STEAHLSNEGUPALK
SIEAUCTCYDRDKEI
ITKODANXEIICSAP
FUCSIEOANNATRTS
CDDNIWRGLTTAISY
AEEPOREHTAEWCOE
UPEREICALGVLECN
OOGESRIGHKIAAPM
VLRTIMMUSMCMXII
ISODNEVEBTPOSTH
BOGYALERECINROC
BERGSCHRUNDWONS

Old 23.05.2004, 20:16   #2
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Blog Entries: 16
Rep Power: 7
Default

Дорогой centrino, извини конечно, но тут тебе готовые проекты никто писать не будет. Если что конкретно пробовал и не получилось, то пожалуйста!

Old 23.05.2004, 20:44   #3
nm
ЙЦУКЕН
 
Join Date: 07 2002
Location: 0x68,0x69,0x72, 0x69,0x6e,0x67, 0x20,0x6e,0x6f, 0x77
Age: 55
Posts: 3,118
Rep Power: 0
Default

хм.
неплохая коммерческая задача :) сколько дашь ?:))))

а вообще - занимался я когда-то классическими кроссвордами.
выводы:
1. без перебора не получится никак :)
2. дерево перебора строишь так, чтоб самые длинные слова использвались сначала, после того, как удалось их распихать - более короткие и т.д. пока не запихаешь все слова в свои места :P

оставшееся добавлять по вкусу :))))

Old 24.05.2004, 06:47   #4
Младенец
 
Join Date: 05 2004
Location: usa
Age: 80
Posts: 35
Rep Power: 0
Default

Quote:
Originally Posted by acid
Дорогой centrino, извини конечно, но тут тебе готовые проекты никто писать не будет. Если что конкретно пробовал и не получилось, то пожалуйста!

не сложный проект .просто я ничего не мыслю в программистике
етот задача для начинаюших
если кто нибуд напишет дайте знать плиз
сенк ю
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 09:18.
Top

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.