AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Languages, Compilers and Interpreters C,C++,C#,.NET,Java,PHP,Perl,SQL and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old May 23, 2004, 14:47   #1
Младенец
 
Join Date: May 2004
Location: usa
Posts: 35
Rep Power: 0
Reputation: 10
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
centrino is offline   Reply With Quote Quote selected
Old May 23, 2004, 20:16   #2
Administrator
 
acid's Avatar
 
Join Date: Sep 2001
Location: South Korea, Gumi
Posts: 7,164
Blog Entries: 15
Rep Power: 10
Reputation: 298
Дорогой centrino, извини конечно, но тут тебе готовые проекты никто писать не будет. Если что конкретно пробовал и не получилось, то пожалуйста!
__________________
Chat with acid


acid is offline   Reply With Quote Quote selected
Old May 23, 2004, 20:44   #3
ЙЦУКЕН
 
Join Date: Jul 2002
Location: 0x68,0x69,0x72, 0x69,0x6e,0x67, 0x20,0x6e,0x6f, 0x77
Posts: 3,114
Rep Power: 7
Reputation: 10
Send a message via ICQ to nm
хм.
неплохая коммерческая задача :) сколько дашь ?:))))

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

оставшееся добавлять по вкусу :))))
nm is offline   Reply With Quote Quote selected
Old May 24, 2004, 06:47   #4
Младенец
 
Join Date: May 2004
Location: usa
Posts: 35
Rep Power: 0
Reputation: 10
Quote:
Originally Posted by acid
Дорогой centrino, извини конечно, но тут тебе готовые проекты никто писать не будет. Если что конкретно пробовал и не получилось, то пожалуйста!

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


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Traffic control program GeniusRaf Web Development 8 Mar 31, 2004 05:57
Development Program Specialist Gayka Jobs 0 Apr 29, 2003 09:03
Program Officer Gayka Jobs 0 Apr 26, 2003 05:46
PHP Grant Program Forever Child Web Development 0 Mar 19, 2003 09:46
Program Programmist_Party; gev2 Fun 6 Jul 4, 2002 02:34


All times are GMT. The time now is 09:05.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link