Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 : Setup Write a C program called scrabble, which reads in a list of words and their location on the board, places them

Problem 1: Setup
Write a C program called scrabble, which reads in a list of words and their location on the board, places
them to the board, and then displays the board.
Input
Your program will read its input from stdin. The remainder of the input consists of several lines:
The first line contains a single integer (N) denoting the size of the board (N N).
The second line contains a second integer (W) denoting the number of words to place.
This is followed by W lines, each containing the location (X,Y), direction (D), and the word (S).
X Y D S
where
X is an integer in the range 0 X < N, denoting the X coordinate of the first letter of the word
Y is an integer in the range 0 Y < N, denoting the Y coordinate of the first letter of the word
D is either H or V, denoting the direction of the word. H for horizontal (left to right) and V for
vertical (top to bottom).
S is a single lower-case word which will be one or more letters.
Finally, there is another integer (F), which for this problem will always be 0.
All words will be in lower-case letters. (Hint: Use scanf to read the input). See example below.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions