[EMAIL PROTECTED] wrote:
> And furthermore, having Python's bitwise operators
> is nice, but it's not nice enough. I need the bitwise
> functionality gmpy provides that's not available in
> Python: scan for position of least significant 1 or 0,
Cute tricks (artifact of two's complement notation):
Clemens Hepper wrote:
> Hi,
>
> [EMAIL PROTECTED] wrote:
> > That's one way to do it. I did it that way because I have the
> > hex patterns memorized.
>
> You should be able to generate your numbers like this:
>
> number = int('001001000100100', 2)
Well, that would be another way, wouldn't it?
Hi,
[EMAIL PROTECTED] wrote:
> That's one way to do it. I did it that way because I have the
> hex patterns memorized.
You should be able to generate your numbers like this:
number = int('001001000100100', 2)
mfg
- eth
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Well, I don't get the prize for most elegant.
>
> But that's partly because I included the ooloop6
> function.
:: snip a bunch of scary code :: :)
Wow, that's impressive. My solution looks a whole lot simpler than
yours, but I certainly could not have done it witho
John Salerno wrote:
> [EMAIL PROTECTED] wrote:
>
> > If you need help in figuring out how to walk through all 4096 possible
> > switch sets, just ask.
>
> Ok, thanks to your list, I figured out a program that works! It's
> probably not the best, and it doesn't really display which switches are
> c
[EMAIL PROTECTED] wrote:
> If you need help in figuring out how to walk through all 4096 possible
> switch sets, just ask.
Ok, thanks to your list, I figured out a program that works! It's
probably not the best, and it doesn't really display which switches are
correct in any apparent way (you h
[EMAIL PROTECTED] wrote:
> John Salerno wrote:
>> John Salerno wrote:
>>> [EMAIL PROTECTED] wrote:
>>>
No. First of all, combining them with the & operator would be
the asnswer to having all four lamps lit in the same position.
But you want exactly 3 (in any combination). The correct
John Salerno wrote:
> John Salerno wrote:
> > [EMAIL PROTECTED] wrote:
> >
> >> No. First of all, combining them with the & operator would be
> >> the asnswer to having all four lamps lit in the same position.
> >> But you want exactly 3 (in any combination). The correct way
> >> to combine the sw
John Salerno wrote:
> [EMAIL PROTECTED] wrote:
>
>> No. First of all, combining them with the & operator would be
>> the asnswer to having all four lamps lit in the same position.
>> But you want exactly 3 (in any combination). The correct way
>> to combine the switches (using my answer of a[7] b[
[EMAIL PROTECTED] wrote:
> No. First of all, combining them with the & operator would be
> the asnswer to having all four lamps lit in the same position.
> But you want exactly 3 (in any combination). The correct way
> to combine the switches (using my answer of a[7] b[2] c[5] d[3])
> is to use th
John Salerno wrote:
> [EMAIL PROTECTED] wrote:
>
> >> (homework? a puzzle book?), I am just
> >> wondering where the puzzle came from.
> >
> > The OP mentioned it came from a puzzle game That made me
> > think there was likely at least one solution.
>
> Right, a computer puzzle game (a Myst-style
John Salerno wrote:
> [EMAIL PROTECTED] wrote:
>
> > You have 4 panels, each with 20 lamps (label them 19 to 0):
> >
> > panel A
> > panel B
> > panel C
> > panel D
>
> I'm sorry for being so dense, but I don't und
John Salerno wrote:
> [EMAIL PROTECTED] wrote:
>
> > a = [0xf5fdc,0xf6edb,0xbddb7,0x6fddd,0xeb7ed,0xb977f,0xbfed3,0xedef5]
> > b = [0xddb7d,0xfaddb,0xde75f,0xeef7a,0xdd77b,0xdfbce,0xb77dd,0x7ef5d]
> > c = [0xf37bd,0xdfaee,0xddd6f,0xddfb6,0xb9efb,0xb7bbe,0xecfbd,0xb75df]
> > d = [0x77edb,0xbb7ee,0x
[EMAIL PROTECTED] wrote:
> a = [0xf5fdc,0xf6edb,0xbddb7,0x6fddd,0xeb7ed,0xb977f,0xbfed3,0xedef5]
> b = [0xddb7d,0xfaddb,0xde75f,0xeef7a,0xdd77b,0xdfbce,0xb77dd,0x7ef5d]
> c = [0xf37bd,0xdfaee,0xddd6f,0xddfb6,0xb9efb,0xb7bbe,0xecfbd,0xb75df]
> d = [0x77edb,0xbb7ee,0xdf773,0x7bdeb,0x7ddaf,0xdeeeb,0x
[EMAIL PROTECTED] wrote:
> You have 4 panels, each with 20 lamps (label them 19 to 0):
>
> panel A
> panel B
> panel C
> panel D
I'm sorry for being so dense, but I don't understand this. There are
four panels,
[EMAIL PROTECTED] wrote:
>> (homework? a puzzle book?), I am just
>> wondering where the puzzle came from.
>
> The OP mentioned it came from a puzzle game That made me
> think there was likely at least one solution.
Right, a computer puzzle game (a Myst-style game called Realms of
Illusion), an
Michael Tobis wrote:
> Yeah, I misread the question, but the gist of my query remains.
>
> > The odds are 100% if there is at least one solution.
>
> Let's not get too philosophical. My question was whether there was an a
> priori reason for believing that there is a solution.
>
> > You want perm
Yeah, I misread the question, but the gist of my query remains.
> The odds are 100% if there is at least one solution.
Let's not get too philosophical. My question was whether there was an a
priori reason for believing that there is a solution.
> You want permutations with replacement, so there
[EMAIL PROTECTED] wrote:
> John Salerno wrote:
> > John Salerno wrote:
> >
> > > Anyway, any advice for how to proceed would be great! I hope I described
> > > it well enough.
> >
> > Ok, after reading the suggestions, I feel better about proceeding. But
> > one question: how exactly do I come up
Michael Tobis wrote:
> First do a little estimation. We know we have to find four out of 16
> switches,
4 panels, eight switches each, 32 total.
> so the number of possibilities to search is only C(4,16) =
> 1820, so an exhaustive search will work.
Yes, but for the wrong reason. It's not combina
John Salerno wrote:
> John Salerno wrote:
>
> > Anyway, any advice for how to proceed would be great! I hope I described
> > it well enough.
>
> Ok, after reading the suggestions, I feel better about proceeding. But
> one question: how exactly do I come up with 32 different 20-bit integers
> for ea
John Salerno wrote:
> [EMAIL PROTECTED] wrote:
>
> > Then you'll want to represent the lights as a 20-bit binary number.
> >
> > Each bit position corresponds to 4 lamps
>
> I'm not sure I understand that. If I use a 20-bit number, wouldn't each
> bit correspond to a single light on each switch? Wh
First do a little estimation. We know we have to find four out of 16
switches, so the number of possibilities to search is only C(4,16) =
1820, so an exhaustive search will work.
These will turn on 15 lights in each set of 20, of which the number of
possibilities is C(15,20)**4 = 57779667567968256
John Salerno wrote:
> Anyway, any advice for how to proceed would be great! I hope I described
> it well enough.
Ok, after reading the suggestions, I feel better about proceeding. But
one question: how exactly do I come up with 32 different 20-bit integers
for each switch? Do I need to figure
[EMAIL PROTECTED] wrote:
> Then you'll want to represent the lights as a 20-bit binary number.
>
> Each bit position corresponds to 4 lamps
I'm not sure I understand that. If I use a 20-bit number, wouldn't each
bit correspond to a single light on each switch? What do you mean that
each bit is
John Salerno wrote:
> Ok, here's a problem I've sort of assigned to myself for fun, but it's
> turning out to be quite a pain to wrap my mind around. It's from a
> puzzle game. It will help if you look at this image:
>
> http://www.johnjsal.devisland.net/switches.jpg
>
> Here's the situation: Each
John Salerno wrote:
> Ok, here's a problem I've sort of assigned to myself for fun, but it's
> turning out to be quite a pain to wrap my mind around. It's from a
> puzzle game. It will help if you look at this image:
>
> http://www.johnjsal.devisland.net/switches.jpg
>
> Here's the situation: E
Ok, here's a problem I've sort of assigned to myself for fun, but it's
turning out to be quite a pain to wrap my mind around. It's from a
puzzle game. It will help if you look at this image:
http://www.johnjsal.devisland.net/switches.jpg
Here's the situation: Each of the four rows in the diagra
28 matches
Mail list logo