Armenian Knowledge Base  

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

Reply
 
LinkBack Thread Tools
Old 23.05.2004, 15:47   #1
Младенец
 
Join Date: 05 2004
Location: usa
Age: 72
Posts: 35
Downloads: 0
Uploads: 0
Reputation: 0 | 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
Reply With Quote
Old 23.05.2004, 21:16   #2
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Downloads: 102
Uploads: 34
Blog Entries: 16
Reputation: 561 | 6
Default

Дорогой centrino, извини конечно, но тут тебе готовые проекты никто писать не будет. Если что конкретно пробовал и не получилось, то пожалуйста!
Reply With Quote
Old 23.05.2004, 21:44   #3
ЙЦУКЕН
 
Join Date: 07 2002
Location: 0x68,0x69,0x72, 0x69,0x6e,0x67, 0x20,0x6e,0x6f, 0x77
Age: 47
Posts: 3,118
Downloads: 0
Uploads: 0
Reputation: 5 | 0
Default

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

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

оставшееся добавлять по вкусу :))))
Reply With Quote
Old 24.05.2004, 07:47   #4
Младенец
 
Join Date: 05 2004
Location: usa
Age: 72
Posts: 35
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

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

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

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 11:18.


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