Jump to content

Recommended Posts

здраствуйте дорогие форумчане

я опять с вопросом но на этот раз поконкретнее

мне нужна программа на С

детали внизу . если кто знает как программировать пожалуйста помогите мне я буду очен благодарен.мне очен нужна это программа до 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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...