[Sugar-devel] progress and issues w/ adding_up

2009-09-03 Thread Bryan Berry
I have adding_up kind of working w/ the new html layout, but it doesn't
actually add up to the correct sum :(

Problem #1 

I kept getting an infinite loop in this section in the distance2() call

I have to admit I don't exactly understand what distance2 is doing
http://git.sugarlabs.org/projects/karma/repos/mainline/blobs/multicanvas/examples/adding_up_to_10/js/lesson.js#line142

for ( var j=0; jhttp://git.sugarlabs.org/projects/karma/repos/mainline/trees/multicanvas


-- 
Bryan W. Berry
Technology Director
OLE Nepal, http://www.olenepal.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] progress and issues w/ adding_up

2009-09-03 Thread Felipe López Toledo
>
> Problem #2
>
> None of the answer boxes holds the correct sum :(
>
> I am not sure where the logic error is but I am hunting for it!
>
> as we discussed yesterday, i have put all this work on the "multicanvas"
> tree.
> http://git.sugarlabs.org/projects/karma/repos/mainline/trees/multicanvas
>
I have fixed the bug

the problem was here:
http://git.sugarlabs.org/projects/karma/repos/mainline/blobs/122ecd00112941ccde74932aef01c93d1b5c7cdb/examples/adding_up_to_10/js/lesson.js#line179

the problem was that "this" inside the callback function (for the click
listener) is not the same "this" of the "each" function
I changed this["id"] to item.id

+ changed language to "spanish" :) (btw. could u get some decent english
audio for "correct"/"incorrect" ?)
+ I have done some other changes (stylistic)



2009/9/3 Bryan Berry 

> I have adding_up kind of working w/ the new html layout, but it doesn't
> actually add up to the correct sum :(
>
> Problem #1
>
> I kept getting an infinite loop in this section in the distance2() call
>
> I have to admit I don't exactly understand what distance2 is doing
>
> http://git.sugarlabs.org/projects/karma/repos/mainline/blobs/multicanvas/examples/adding_up_to_10/js/lesson.js#line142
>
> for ( var j=0; jif ( k.geometry.distance2( pos[j], {"x": x, "y": y} ) < 80 ) {
> flag
> = true;
>break; }  }
> }while ( flag === true );
> pos.push( { "x":x, "y": y } );
> k.library.images[ imgId ].draw(ctx, x, y )}
>
> Also, i don't understand how u can call distance2 w/ pos[j] when pos is
> still an empty array. Maybe it is because js just does a lot of weird
> stuff.
>
> Problem #2
>
> None of the answer boxes holds the correct sum :(
>
> I am not sure where the logic error is but I am hunting for it!
>
> as we discussed yesterday, i have put all this work on the "multicanvas"
> tree.
> http://git.sugarlabs.org/projects/karma/repos/mainline/trees/multicanvas
>
>
> --
> Bryan W. Berry
> Technology Director
> OLE Nepal, http://www.olenepal.org
>
>


-- 
Felipe López Toledo
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] progress and issues w/ adding_up

2009-09-03 Thread Bryan Berry
On Thu, 2009-09-03 at 22:07 -0500, Felipe López Toledo wrote:
> Problem #2
> 
> None of the answer boxes holds the correct sum :(
> 
> I am not sure where the logic error is but I am hunting for
> it!
> 
> as we discussed yesterday, i have put all this work on the
> "multicanvas"
> tree.
> 
> http://git.sugarlabs.org/projects/karma/repos/mainline/trees/multicanvas
> I have fixed the bug
> 
> the problem was here:
> http://git.sugarlabs.org/projects/karma/repos/mainline/blobs/122ecd00112941ccde74932aef01c93d1b5c7cdb/examples/adding_up_to_10/js/lesson.js#line179

awesome! 

> the problem was that "this" inside the callback function (for the
> click listener) is not the same "this" of the "each" function
> I changed this["id"] to item.id


> + changed language to "spanish" :) (btw. could u get some decent
> english audio for "correct"/"incorrect" ?)

Yes!
> + I have done some other changes (stylistic)
> 
> 
> 
> 2009/9/3 Bryan Berry 
> I have adding_up kind of working w/ the new html layout, but
> it doesn't
> actually add up to the correct sum :(
> 
> Problem #1
> 
> I kept getting an infinite loop in this section in the
> distance2() call
> 
> I have to admit I don't exactly understand what distance2 is
> doing
> 
> http://git.sugarlabs.org/projects/karma/repos/mainline/blobs/multicanvas/examples/adding_up_to_10/js/lesson.js#line142
> 
> for ( var j=0; jif ( k.geometry.distance2( pos[j], {"x": x, "y": y} ) <
> 80 ) { flag
> = true;
>break; }  }
> }while ( flag === true );
> pos.push( { "x":x, "y": y } );
> k.library.images[ imgId ].draw(ctx, x, y )}
> 
> Also, i don't understand how u can call distance2 w/ pos[j]
> when pos is
> still an empty array. Maybe it is because js just does a lot
> of weird
> stuff.
> 
> Problem #2
> 
> None of the answer boxes holds the correct sum :(
> 
> I am not sure where the logic error is but I am hunting for
> it!
> 
> as we discussed yesterday, i have put all this work on the
> "multicanvas"
> tree.
> 
> http://git.sugarlabs.org/projects/karma/repos/mainline/trees/multicanvas
> 
> 
> --
> Bryan W. Berry
> Technology Director
> OLE Nepal, http://www.olenepal.org
> 
> 
> 
> 
> -- 
> Felipe López Toledo
-- 
Bryan W. Berry
Technology Director
OLE Nepal, http://www.olenepal.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel