Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 43395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:29:19+00:00 2026-05-10T15:29:19+00:00

I created a program using dev-cpp and wxwidgets which solves a puzzle. The user

  • 0

I created a program using dev-cpp and wxwidgets which solves a puzzle.

The user must fill the operations blocks and the results blocks, and the program will solve it. I’m solving it using brute force, I generate all non-repeated 9 length number combinations using a recursive algorithm. It does it pretty fast.

Up to here all is great!

But the problem is when my program operates depending the character on the blocks. Its extremely slow (it never gets the answer), because of the chars comparation against +, -, *, etc. I’m doing a CASE.

Is there some way or some programming language which allows dynamic creation of operators? So I can define the operator ROW1COL2 to be a +, and the same way to all other operations.

I leave a screenshot of the app, so its easier to understand how the puzzle works.

http://www.imageshare.web.id/images/9gg5cev8vyokp8rhlot9.png

PD: The algorithm works, I tried it with a trivial puzzle, and solved it in a second.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:29:19+00:00Added an answer on May 10, 2026 at 3:29 pm

    Not sure that this is really what you’re looking for but..
    Any Object Oriented language such as C++ or C# will allow you to create an ‘Operator’ base class and then to derive from this base class a ‘PlusOperator’ or ‘MinusOperator’ etc’. this is the standard way to avoid such case statements.

    However I am not sure this will solve your performance problem.
    Using plain brute force for such a problem will result you in an exponential solution. this will seem to work fast for small input – say completing all the numbers. But if you want to complete the operations its a much larger problem with alot more possibilities.
    So its likely that even without the CASE your program is not going to be able to solve it.

    The right way to try to solve this kind of problems is using some advanced search methods which use some Heuristic function. See the A* (A-star) algorithm for example.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You don't need to copy the assembly to the NAnt… May 11, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer I'm not sure what you want. If it is slight… May 11, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer Yep. The timeit module in the standard library is how… May 11, 2026 at 11:43 pm

Related Questions

I've recently started poking around in Visual Studio 2005, and I'm mucking about in
I'm having a hard time figuring this problem out - I am trying to
I've just started using Git and it's possible I've missed something obvious, but here
This is quite strange for me, but I'm getting an unexpected and random segmentation

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.