473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

a somewhat strange program

Ok, this might be difficult to explain, so if it doesn't make sense, I
apologize. I'm playing a game that has a fairly complicated puzzle in
it, and I started thinking how I might make a C# program to figure it out.

There are four different panels, each of which has eight switches that
control two rows of lights, and each row has ten lights. Ultimately,
what needs to be done is flip one switch per panel so that each light in
each row is lit up from three of the four switches (two isn't enough,
and four overloads the circuit).

Alright, that might make no sense, so here's sort of a diagram that I
hope looks decent:

.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .

Each period is a light, and the eight columns are each controlled by one
switch on a panel. So this diagram would be repeated three more times
for the other panels.

Anyway, that's all just to give you an idea of what's going on. What I'm
asking for is some idea for how to get started with writing a program to
figure it out. I thought maybe I could duplicate these columsn as
textboxes on a form, and enter 1 or 0 for on or off, and then somehow
read through every possible combination to see which ones match up so
that in every spot (every light/period) there are three 1s and one 0.

Did that make any sense at all? If not, feel free to disregard! :)
Nov 17 '05 #1
2 1262
Is this game available to anyone? If so what is its name? If I can see the
rules I can help you with an algorithm...

"John Salerno" <jo******@NOSPAMgmail.com> wrote in message
news:pr******************************@rcn.net...
Ok, this might be difficult to explain, so if it doesn't make sense, I
apologize. I'm playing a game that has a fairly complicated puzzle in it,
and I started thinking how I might make a C# program to figure it out.

There are four different panels, each of which has eight switches that
control two rows of lights, and each row has ten lights. Ultimately, what
needs to be done is flip one switch per panel so that each light in each
row is lit up from three of the four switches (two isn't enough, and four
overloads the circuit).

Alright, that might make no sense, so here's sort of a diagram that I hope
looks decent:

. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .

Each period is a light, and the eight columns are each controlled by one
switch on a panel. So this diagram would be repeated three more times for
the other panels.

Anyway, that's all just to give you an idea of what's going on. What I'm
asking for is some idea for how to get started with writing a program to
figure it out. I thought maybe I could duplicate these columsn as
textboxes on a form, and enter 1 or 0 for on or off, and then somehow read
through every possible combination to see which ones match up so that in
every spot (every light/period) there are three 1s and one 0.

Did that make any sense at all? If not, feel free to disregard! :)

Nov 17 '05 #2
Tom Jones wrote:
Is this game available to anyone? If so what is its name? If I can see the
rules I can help you with an algorithm...


Yes, it's an adventure game called Realms of Illusion (also called
Sentinel: Descendents in Time), but there really aren't any "rules",
since it is just one puzzle in the game.

I have since gotten past the puzzle with some help from a hint guide,
but I'm still interested in an algorithm to do this. I think maybe
nested for loops going through arrays might work.

(On a personal note: I can't believe how hard this puzzle was. At first,
I was hoping that my method for solving it was overly complex, but it
turns out I was right. I knew exactly how the puzzle worked and what
needed to be done to solve it, but solving it involved comparing 20
lights per switch, 8 switches per panel, and 4 panels! I can't believe a
game designer would make something like that. 4 switches per panel would
have been enough.)
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Federico | last post by:
Hi all, I don't know if this topic is perhaps a little bit off-topic, anyway I have a strange problem in transforming an XML file in an HTML file using XSLT form a Java program written with...
41
by: Odd-R. | last post by:
I have to lists, A and B, that may, or may not be equal. If they are not identical, I want the output to be three new lists, X,Y and Z where X has all the elements that are in A, but not in B, and...
8
by: Victor Lamberty | last post by:
Greetings C coders I am new to the world of C and have been trying to compile this program. I got the result that I wanted but outputed it in a strange way it put it before the prompt is there a...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
1
by: ralphsieminsky | last post by:
I am seeing a strange behavior with a managed/unmanaged C++ program. The program is a large application made of DLLs, COM components, and an exe. When I recompile the exe with /clr a problem...
1
by: hansolox1 | last post by:
The following program simply sets the icon of a form called form1. When I get the name of the embedded icon using GetManifestResourceNames(), I store the name in a string variable called s. The...
1
by: stromhau | last post by:
Ok, i have a file with main and an additional .cpp file i include in the main file but i get a lot of strange warnings when including. Both files compile just great separately. It seems that it have...
6
by: markus.litz | last post by:
Hello, I have a strange problem with some of my c++ code. I have a normal for- loop like this for(int i = 1; ..... on MS-Windows with a Microsoft compiler everything is alright, but when I...
4
by: kj | last post by:
I'm running into a strange seg fault with the module cjson. The strange part is that it does not occur when I run the code under Emacs' Pydb. Here's an example: import sys, cjson d1 =...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.