Skip to content

Commit

Permalink
Clarifications during interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhmm committed Mar 25, 2023
1 parent 80d94a9 commit fc045b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@
.idea/
Db*.solutions/

/enc_temp_folder
11 changes: 9 additions & 2 deletions libgen/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ PatternRelationSystem::PatternRelationSystem(std::istream& in)

void PatternRelationSystem::Ask(const omnn::math::Variable& v)
{
std::cout << "What would be the " << v << '?' << std::endl;
std::cout << "\nWhat would be the " << v << '?' << std::endl;
std::string line;
do {
std::cin >> line;
if(!line.empty())
Add(v.Equals({ line, GetVarHost() }));
Expand All @@ -44,12 +45,18 @@ void PatternRelationSystem::Ask(const omnn::math::Variable& v)
std::cin >> line;
Add({ line, GetVarHost() });
}
} while (line.empty());
}

omnn::math::Valuable PatternRelationSystem::Get(const omnn::math::Variable& v)
{
for (;;)
{
auto known = Known(v);
if (known.size()) {
return *known.cbegin();
}

try {
solutions_t solutions;
solutions = Solve(v);
Expand All @@ -70,7 +77,7 @@ omnn::math::Valuable PatternRelationSystem::Get(const omnn::math::Variable& v)
{
}

Ask(width);
Ask(v);
}
}

Expand Down

0 comments on commit fc045b0

Please sign in to comment.