word Puzzle 的程序实现
(2010-01-20 21:47:14)
标签:
wordpuzzle找单词it |
分类: IT |
wordpuzzle.txt如下:
R I R R G T S J R H K E I T V I D B Z O
M G N I F F U T S I O Y R V A G F F X Z
P D O Z L Z J L T A S Y E S E M N V X L
P D D E H J F K P K X Z E U H T C C K L
U O J P N G O R K G R I S I S T Q Z L A
Y H P M I K G F D V R E W O L F Y A M F
B T F E F M I E R R C M P E P L B U Z X
B N C X C S R E E E Z A D P I T B F P U
Y R X A O A B B P U Y Y T M O Z J F I U
O O M N X M N O D W V B A O F S L E B V
Y C T N E A T P E M I F F H P A R A D E
D L A V R A A A I T Q W Q R O Z G S X C
G S O C T X H I R E C S M V A G F T M H
E N M O T A Z D D J C J T H A N K F U L
H Q E I E I P N I K P M U P T U J B F U
J S O J R Z G O D R W Z G Z U K K U K C
J W X M V G W X A D I N N E R Y J H B F
N M F V A N L N T S U B B Y K J O H P P
K C Z M D H J I B F S Y B A E V F U J E
T U I G K T M D P C F V Z C Y Y M K Z B
word.txt如下:
NOVEMBER
TURKEY
STUFFING
HAM
PUMPKINPIE
CRANBERRIES
POTATOES
PECANPIE
PILGRIMS
THANKFUL
MAYFLOWER
CORN
DINNER
FAMILY
FOOTBALL
FEAST
PARADE
程序实现代码:
// wordPuzzle.cpp : 定义控制台应用程序的入口点。
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
char puzzle[20][20];
char word[17][15];
bool isHere[20][20];
ofstream outfile("result.txt");
void initArray()
{
}
void display(bool Spuzzle=true,bool Sword=false)
{
}
bool search(const char *wordChar,int row,int col, int pos,int
direction)
{
}
void resetIshere()
{
}
void outputResult(char *wordth)
{
}
void findWord(char *wordth)
{
}
int _tmain(int argc, _TCHAR* argv[])
{
}
最终输出如下:
NOVEMBER
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # R# # # # # # # # # # #
# # # # # # # E# # # # # # # # # # # #
# # # # # # B# # # # # # # # # # # # #
# # # # # M# # # # # # # # # # # # # #
# # # # E# # # # # # # # # # # # # # #
# # # V# # # # # # # # # # # # # # # #
# # O# # # # # # # # # # # # # # # # #
# N# # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
=================================
TURKEY
。。。以下省略.