Я пытаюсь сделать это для более крупных сетей. Цель кода состоит в том, чтобы взять текстовый файл с размерами сетки и словами, которые должны появиться в сетке и словах, чем не могут появиться в сетке, а затем сделать как можно больше комбинаций этих слов и случайных букв для заполнения сетки. Мне не обязательно нужен от вас код, так как это задняя часть, и я не знаю, где стоят мораль, но хотели бы, чтобы какие -либо советы. < /P>
#include
#include
#include
#include
#include
#include
#include
// Global Variables Here
std::vector include_words;
std::vector disclude_words;
int grid_width;
int grid_height;
std::vector wordCount;
// Helper functions
/*
name of file to be read and information stored
Takes in a file name, reads file line by line, stores grid dimensions
and words
*/
void read_file(const std::string& input_file_name) {
std::ifstream input(input_file_name);
// Check if the file is open
if (!input) {
std::cerr > grid_height;
wordCount = std::vector(grid_height, std::vector
(grid_width, 0));
// Temporary variables for reading lines
std::string line;
char symbol;
std::string word;
// Read the rest of the file line by line
while (input >> symbol >> word) {
if (symbol == '+') {
// Add the word to the include_words vector
include_words.push_back(word);
} else if (symbol == '-') {
// Add the word to the disclude_words vector
disclude_words.push_back(word);
std::reverse(word.begin(), word.end());
disclude_words.push_back(word);
} else {
// Handle invalid symbols (optional)
std::cerr
Подробнее здесь: https://stackoverflow.com/questions/795 ... mprovement
Улучшение обратного поиска слов [закрыто] ⇐ C++
Программы на C++. Форум разработчиков
1741818811
Anonymous
Я пытаюсь сделать это для более крупных сетей. Цель кода состоит в том, чтобы взять текстовый файл с размерами сетки и словами, которые должны появиться в сетке и словах, чем не могут появиться в сетке, а затем сделать как можно больше комбинаций этих слов и случайных букв для заполнения сетки. Мне не обязательно нужен от вас код, так как это задняя часть, и я не знаю, где стоят мораль, но хотели бы, чтобы какие -либо советы. < /P>
#include
#include
#include
#include
#include
#include
#include
// Global Variables Here
std::vector include_words;
std::vector disclude_words;
int grid_width;
int grid_height;
std::vector wordCount;
// Helper functions
/*
name of file to be read and information stored
Takes in a file name, reads file line by line, stores grid dimensions
and words
*/
void read_file(const std::string& input_file_name) {
std::ifstream input(input_file_name);
// Check if the file is open
if (!input) {
std::cerr > grid_height;
wordCount = std::vector(grid_height, std::vector
(grid_width, 0));
// Temporary variables for reading lines
std::string line;
char symbol;
std::string word;
// Read the rest of the file line by line
while (input >> symbol >> word) {
if (symbol == '+') {
// Add the word to the include_words vector
include_words.push_back(word);
} else if (symbol == '-') {
// Add the word to the disclude_words vector
disclude_words.push_back(word);
std::reverse(word.begin(), word.end());
disclude_words.push_back(word);
} else {
// Handle invalid symbols (optional)
std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/79504936/inverse-word-search-improvement[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия