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 7603237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:36:44+00:00 2026-05-30T23:36:44+00:00

I wrote a small game a while back in Flash that I’m now re-coding

  • 0

I wrote a small game a while back in Flash that I’m now re-coding in C# with my new programming experience. However this time around, I want to be able to implement the idea of detecting when the grid has become impossible to solve. This is more of a conceptual puzzle problem then anything, but I’ll take any resources you may have.

The game involves moving the player up, down, left, or right around the map, pushing blocks around. The level is won when there are no more blocks of certain kinds left. However it’s easy to find yourself in a no longer solvable map. For example if the player starts off stuck in a ring of wall blocks, then there’s no way to solve it at all.

Sorry for the abstract question, but does anybody have any tips for this?

  • 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. Editorial Team
    Editorial Team
    2026-05-30T23:36:46+00:00Added an answer on May 30, 2026 at 11:36 pm

    You basically have two options. Both have advantages and disadvantages, so you might want to combine ideas from both into your solution.

    Option 1: Write a heuristic

    Think about situations which make the game impossible to solve (such as being stuck in a ring of wall blocks). Detect such situations and print “no more moves” as soon as such a situation occurs. The more such situations you can think of and implement, the better your algorithm becomes.

    Advantage: Easy and fast.

    Disadvantage: There will be cases where the game is unsolvable but your algorithm does not detect it.

    Option 2: Write a solver

    Write a program that, given a state of your game (where is the player, where are the blocks, etc.), outputs a list of steps that can be taken to solve the game (or null or some other special value when there is no solution anymore — this is your “no more moves” case).

    How to implement something like this depends on the exact rules of the game. A simple approach is to do a Breadth-First Search on the Game Tree: Every node in your tree is a game state, and every arc between nodes is a possible action that the player could take (move up, move down, etc.).

    Advantage: This reliably detects when the game cannot be won anymore. In addition, this program can be used to give hints to the player when he gets stuck.

    Disadvantage: Depending on the complexity of your game, calculating a solution might take ages. For very simple games this could work; for somewhat simple games it might take very long, and for fairly complex games such a chess or checkers, it’s very hard or impossible.

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

Sidebar

Related Questions

I wrote this small game at http://amarnus.me/games/dodge . Now if you trying playing the
I wrote a small Shotgun app, however, the section of code that needs to
I am new to programming. I am creating a small word jumble game to
I wrote a small PHP application several months ago that uses the WordPress XMLRPC
I wrote a small PHP application that I'd like to distribute. I'm looking for
We wrote a small Windows class library that implements extension methods for some standard
I wrote some small apps using .NET 3.5 but now I am stuck with
I wrote a small app that turns out to be using a lot of
I wrote a small program, that creates files at an interval of 1 minute.
I'm attempting to implement a Save/Load feature into my small game. To accomplish this

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.