Getting Started
Log onto a computer science server making sure to change the port number.
Follow these instructions to get your files ready to start lab.
- Use
wget
to download the file at http://cs.longwood.edu/courses/cmsc162/f18/files/lab8.tgz
- Uncompress the lab8.tgz file by using
tar -xvzf lab8.tgz
- Use
ls
to see that there is a new directory called lab8
- Use
cd lab8
to change directory to the lab8 directory
The Problem
A popular board game requires you make words out of combinations of letters. We will write a program that uses the TWL06.txt word list to identify all the words that can be made out of a group of letters.
This lab can be completed using a map(associative array) class. You will use one of the map classes provided in STL. Instead of using cin and cout, we will be using the curses library for output. Curses is a library which allows linux programs to manipulate the console screen (think vim)! I have created a wrapper class for you.
- Use another style of output
- Use STL for data structure and generic functions
Implementation
You have been given a file named main.cpp
which contains your main and a function to draw the screen.
Your algorithm will need to do the following things outside of the loop:
- Read in the TWL06.txt file line by line (there is one word per line)
- Change each word to all caps
- The index for each word will be the word sorted in alphabetical order
Somewhere inside the loop (or inside draw?) you will need to:
- Sort your search characters in alphabetical order
- Change each word to all caps
- Print the data out to the screen
You do not need to find words from subsets of characters. There is extra credit available for finding all words.
Lines are seperated by CRLF.
Handin
When you are done you need to hand in your lab. The easiest way is to type make handin
.
You lab is due at 11:59pm Oct. 30th 2018.