# Re: Reverse 'pixelcoloring' and total amount of colors

```Hi Mike,

The exercises are actually binary exercises but the children don't know.
All they know is a 'puzzle' to solve with pixelcoloring.
Funny I can solve it this way :-)
Still figuring how to do it because the children instruction is not just
binary writing as you explained it.```
```
Did you see my picture?
http://www.camelcaps.nl/pixelcoding/pixelcoding.jpg

greetings.

William

2018-03-05 16:10 GMT+01:00 Mike Bonner via use-livecode <
use-livecode@lists.runrev.com>:

> If you want to know which "pixel" is on in a row, you could treat them as
> binary bits.  Farthest right in a row is bit 1, next to the left is bit 2..
>
> So your buttons could be   0   0   1   0   1   0  1
>                                           64 32 16  8   4   2   1
> for a total of 21 which would then tell you the "bit patteren" of your row.
>
> Not fully awake yet, so if there is anything wrong with my example,
> hopefully it still makes sense.
>
> On Mon, Mar 5, 2018 at 5:50 AM, William de Smet via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > Your app is the same as what I did before and that's quit easy to do.
> >
> > For now I want to build instruction cards based upon a pixel drawing.
> > First you makel your drawing and then it gives you your instruction card.
> > The other way around.
> >
> > My question is how to do that?
> >
> >
> >
> > groeten,
> >
> > William
> >
> >
> >
> > 2018-03-05 13:40 GMT+01:00 Jose Enrique Montero via use-livecode <
> > use-livecode@lists.runrev.com>:
> >
> > > I made a similar application, you can look,
> babygrid&hl=es
> > >
> > > best regards
> > >
> > >
> > > 2018-03-05 3:55 GMT-04:00 William de Smet via use-livecode <
> > > use-livecode@lists.runrev.com>:
> > >
> > > > Hi there,
> > > >
> > > > This is quite a challenge for me.
> > > > I an trying to build a template in which users (small children) can
> > > > 'pixeldraw' something and based on the drawing the instruction will
> be
> > > > The instruction is needed for other children to make the pixel
> drawing.
> > > > The instruction is quite special.
> > > >
> > > > The template is a square with 49 buttons (7x7) for the coloring and
> 49
> > > > fields for the instruction.
> > > > The coloring of the buttons is no problem. The 'reverse' coloring is
> > the
> > > > problem.
> > > > I can get the amount of a colors in a row (5 x white and 2 x blue)
> but
> > > how
> > > > do I determine on which place (in which buttons) these colors are.
> > > > The first row is: 3 white - 1 blue - 2 white - 1 blue
> > > > But how do I output it like: 3 - 1- 2 - 1 ? And each number needs to
> be
> > > in
> > > > another field.
> > > >
> > > > ---------------
> > > > on mouseup
> > > > if the backgroundcolor of btn "f1" is 255,255,255 then add "1" to
> field
> > > > "v1"
> > > > end mouseup
> > > >
> > > > or
> > > >
> > > > on mouseup
> > > > repeat with x=1 to 7
> > > > put "f"&x into tButton
> > > > if the backgroundcolor of btn tButton is 255,255,255
> > > > then
> > > > add "1" to field "v1"
> > > > else
> > > > add "1" to field "v2"
> > > > end if
> > > > end mousep
> > > >
> > > > -------------------
> > > >
> > > > What is the best way to do this?
> > > >
> > > > Any pointers are welcome.
> > > >
> > > >
> > > > To easier understand what i am trying to do, see this image:
> > > > http://www.camelcaps.nl/pixelcoding/pixelcoding.jpg
> > > >
> > > >
> > > >
> > > > greetings,
> > > >
> > > > William
> > > > _______________________________________________
> > > > use-livecode mailing list
> > > > use-livecode@lists.runrev.com
> > > > Please visit this url to subscribe, unsubscribe and manage your
> > > > subscription preferences:
> > > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > > >
> > > _______________________________________________
> > > use-livecode mailing list
> > > use-livecode@lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com