librelist archives

« back to archive

Pixel plotting

Pixel plotting

From:
Douglas Allen
Date:
2013-09-25 @ 23:57
Hi Guys.

Before we think this thing is ready for more public release could we at
least make sure there is either good documentation for this and or some
methods down in the lib. Half the fun of the old programs like QBASIC and
what have you were from being able to give x, y, color and plot like
matplot or better.
I miss those days. Seems anytime we want to do this we either have to use
some language we haven't learned yet like Python or C and get some extra
libs to do it with. Good ol BASIC, GWBASIC, COMMODORE BASIC, and QBASIC had
or has these routines built right in. I hate to see shoes go away empty
handed.

Thanks.

Re: [shoes] Pixel plotting

From:
Tobias Pfeiffer
Date:
2013-09-26 @ 00:10
Hi Douglas,

so you are looking for a method to like draw a single pixel?

I dunno if we have that right now, there is oval which you could make 
behave like that/wrap it like that by giving it a small radius: 
http://shoesrb.com/manual/Art.html#oval

Otherwise please feel free to open an issue at the shoes4 repository: 
https://github.com/shoes/shoes4/issues

It's something that we might want to do in a future release and it 
should be simple, however the first release is aimed at implementing 
all the features of the old shoes and I don't really want to add to 
that because I really WANT to release it. However it is open source so 
if you or someone else really wants to have that make a pull request 
(after we discuseed about DSL etc.) and I'd be happy to merge that in.

Cheers,
Tobi

On Wed 25 Sep 2013 04:57:11 PM PDT, Douglas Allen wrote:
> Hi Guys.
>
> Before we think this thing is ready for more public release could we
> at least make sure there is either good documentation for this and or
> some methods down in the lib. Half the fun of the old programs like
> QBASIC and what have you were from being able to give x, y, color and
> plot like matplot or better.
> I miss those days. Seems anytime we want to do this we either have to
> use some language we haven't learned yet like Python or C and get some
> extra libs to do it with. Good ol BASIC, GWBASIC, COMMODORE BASIC, and
> QBASIC had or has these routines built right in. I hate to see shoes
> go away empty handed.
>
> Thanks.
>

Re: [shoes] Pixel plotting

From:
Peter Fitzgibbons
Date:
2013-09-26 @ 00:46
HI Folks,

Not to be too pedestrian (ok, maybe)... isn't a single pixel "just a
special line" ?
From a design perspective, it would make sense to me to have this if the
closest relative in the native backend is X::Line.  It's pretty easy math
to translate Point draw operations into the coordinated LInes.

One consideration might be memory.  Will filling a window with X::Pixels
blow out the memory model ?

This is cool stuff!  I'm looking forward to seeing how it works out!

Kindest Regards,

Peter Fitzgibbons
(847) 859-9550
Email: peter.fitzgibbons@gmail.com
IM GTalk: peter.fitzgibbons
IM AOL: peter.fitzgibbons@gmail.com


On Wed, Sep 25, 2013 at 7:10 PM, Tobias Pfeiffer <
tobias.pfeiffer@student.hpi.uni-potsdam.de> wrote:

> Hi Douglas,
>
> so you are looking for a method to like draw a single pixel?
>
> I dunno if we have that right now, there is oval which you could make
> behave like that/wrap it like that by giving it a small radius:
> http://shoesrb.com/manual/Art.html#oval
>
> Otherwise please feel free to open an issue at the shoes4 repository:
> https://github.com/shoes/shoes4/issues
>
> It's something that we might want to do in a future release and it
> should be simple, however the first release is aimed at implementing
> all the features of the old shoes and I don't really want to add to
> that because I really WANT to release it. However it is open source so
> if you or someone else really wants to have that make a pull request
> (after we discuseed about DSL etc.) and I'd be happy to merge that in.
>
> Cheers,
> Tobi
>
> On Wed 25 Sep 2013 04:57:11 PM PDT, Douglas Allen wrote:
> > Hi Guys.
> >
> > Before we think this thing is ready for more public release could we
> > at least make sure there is either good documentation for this and or
> > some methods down in the lib. Half the fun of the old programs like
> > QBASIC and what have you were from being able to give x, y, color and
> > plot like matplot or better.
> > I miss those days. Seems anytime we want to do this we either have to
> > use some language we haven't learned yet like Python or C and get some
> > extra libs to do it with. Good ol BASIC, GWBASIC, COMMODORE BASIC, and
> > QBASIC had or has these routines built right in. I hate to see shoes
> > go away empty handed.
> >
> > Thanks.
> >
>

Re: [shoes] Pixel plotting

From:
Douglas Allen
Date:
2013-09-26 @ 14:32
Yes and yes to u ' s. That is all nice but it needs to be documented. I
found a way from stackexchange but why should we have to go searching? And
I feel that this could be a simple upgrade or patch. I'm just not a hacker
who likes to twiddle with what exists already.
here' s a quick example:

def point(x,y,color, bg_color)
 stroke color
 line x,y,x,y+1
 stroke bg_color
 line x,y+1,x+1,y+1
end

Shoes.app  :height => 760, :width => 1024, :title => "     Roseland
Revisited" do
 @centerx, @centery = width / 2, height / 2
 @radius = @centerx / @centery * @centerx
 a = 1024 / 760
 g = 665
 background white
  (0..6.29).step(0.000175) do |i|
    r = @radius * Math.sin(g * i)
    x = (r * Math.cos(i)) + @centerx
    y = (r * Math.sin(i)) * a + @centery
    point x.to_i, y.to_i, violet, white
  end

end

The whole idea came from an old BASIC program. But the community out there
is looking just for things like this. If we haven't learned enough about
Ruby and Shoes then how can a new person figure this out? I'm only
considering their needs. And this would go well with the mandelbrot. I used
to do those in basic and they took time to plot. Now the closest good one
is in Java.

We need to decide on a good name for the function though. Basic used at
first :set then went and called it :pset. What do you all think? A short
line yes yes yes. lol



On Wed, Sep 25, 2013 at 7:46 PM, Peter Fitzgibbons <
peter.fitzgibbons@gmail.com> wrote:

> HI Folks,
>
> Not to be too pedestrian (ok, maybe)... isn't a single pixel "just a
> special line" ?
> From a design perspective, it would make sense to me to have this if the
> closest relative in the native backend is X::Line.  It's pretty easy math
> to translate Point draw operations into the coordinated LInes.
>
> One consideration might be memory.  Will filling a window with X::Pixels
> blow out the memory model ?
>
> This is cool stuff!  I'm looking forward to seeing how it works out!
>
> Kindest Regards,
>
> Peter Fitzgibbons
> (847) 859-9550
> Email: peter.fitzgibbons@gmail.com
> IM GTalk: peter.fitzgibbons
> IM AOL: peter.fitzgibbons@gmail.com
>
>
> On Wed, Sep 25, 2013 at 7:10 PM, Tobias Pfeiffer <
> tobias.pfeiffer@student.hpi.uni-potsdam.de> wrote:
>
>> Hi Douglas,
>>
>> so you are looking for a method to like draw a single pixel?
>>
>> I dunno if we have that right now, there is oval which you could make
>> behave like that/wrap it like that by giving it a small radius:
>> http://shoesrb.com/manual/Art.html#oval
>>
>> Otherwise please feel free to open an issue at the shoes4 repository:
>> https://github.com/shoes/shoes4/issues
>>
>> It's something that we might want to do in a future release and it
>> should be simple, however the first release is aimed at implementing
>> all the features of the old shoes and I don't really want to add to
>> that because I really WANT to release it. However it is open source so
>> if you or someone else really wants to have that make a pull request
>> (after we discuseed about DSL etc.) and I'd be happy to merge that in.
>>
>> Cheers,
>> Tobi
>>
>> On Wed 25 Sep 2013 04:57:11 PM PDT, Douglas Allen wrote:
>> > Hi Guys.
>> >
>> > Before we think this thing is ready for more public release could we
>> > at least make sure there is either good documentation for this and or
>> > some methods down in the lib. Half the fun of the old programs like
>> > QBASIC and what have you were from being able to give x, y, color and
>> > plot like matplot or better.
>> > I miss those days. Seems anytime we want to do this we either have to
>> > use some language we haven't learned yet like Python or C and get some
>> > extra libs to do it with. Good ol BASIC, GWBASIC, COMMODORE BASIC, and
>> > QBASIC had or has these routines built right in. I hate to see shoes
>> > go away empty handed.
>> >
>> > Thanks.
>> >
>>
>
>

Re: [shoes] Pixel plotting

From:
Douglas Allen
Date:
2013-09-26 @ 14:42
P.S. And for you windows users, you can get QBasic installer from
sourceforge. Still works well. I just don't care for the editor much. It
was based on edit.com but it still works. I tend to use notepad++ more
these days for one because it will open a whole slew of files at once. And
it's note a darkfish modie. Sublime is my next choice only for haml because
it keeps the indentation on track.


On Thu, Sep 26, 2013 at 9:32 AM, Douglas Allen <kb9agt@gmail.com> wrote:

> Yes and yes to u ' s. That is all nice but it needs to be documented. I
> found a way from stackexchange but why should we have to go searching? And
> I feel that this could be a simple upgrade or patch. I'm just not a hacker
> who likes to twiddle with what exists already.
> here' s a quick example:
>
> def point(x,y,color, bg_color)
>  stroke color
>  line x,y,x,y+1
>  stroke bg_color
>  line x,y+1,x+1,y+1
> end
>
> Shoes.app  :height => 760, :width => 1024, :title => "     Roseland
> Revisited" do
>  @centerx, @centery = width / 2, height / 2
>  @radius = @centerx / @centery * @centerx
>  a = 1024 / 760
>  g = 665
>  background white
>   (0..6.29).step(0.000175) do |i|
>     r = @radius * Math.sin(g * i)
>     x = (r * Math.cos(i)) + @centerx
>     y = (r * Math.sin(i)) * a + @centery
>     point x.to_i, y.to_i, violet, white
>   end
>
> end
>
> The whole idea came from an old BASIC program. But the community out there
> is looking just for things like this. If we haven't learned enough about
> Ruby and Shoes then how can a new person figure this out? I'm only
> considering their needs. And this would go well with the mandelbrot. I used
> to do those in basic and they took time to plot. Now the closest good one
> is in Java.
>
> We need to decide on a good name for the function though. Basic used at
> first :set then went and called it :pset. What do you all think? A short
> line yes yes yes. lol
>
>
>
> On Wed, Sep 25, 2013 at 7:46 PM, Peter Fitzgibbons <
> peter.fitzgibbons@gmail.com> wrote:
>
>> HI Folks,
>>
>> Not to be too pedestrian (ok, maybe)... isn't a single pixel "just a
>> special line" ?
>> From a design perspective, it would make sense to me to have this if the
>> closest relative in the native backend is X::Line.  It's pretty easy math
>> to translate Point draw operations into the coordinated LInes.
>>
>> One consideration might be memory.  Will filling a window with X::Pixels
>> blow out the memory model ?
>>
>> This is cool stuff!  I'm looking forward to seeing how it works out!
>>
>> Kindest Regards,
>>
>> Peter Fitzgibbons
>> (847) 859-9550
>> Email: peter.fitzgibbons@gmail.com
>> IM GTalk: peter.fitzgibbons
>> IM AOL: peter.fitzgibbons@gmail.com
>>
>>
>> On Wed, Sep 25, 2013 at 7:10 PM, Tobias Pfeiffer <
>> tobias.pfeiffer@student.hpi.uni-potsdam.de> wrote:
>>
>>> Hi Douglas,
>>>
>>> so you are looking for a method to like draw a single pixel?
>>>
>>> I dunno if we have that right now, there is oval which you could make
>>> behave like that/wrap it like that by giving it a small radius:
>>> http://shoesrb.com/manual/Art.html#oval
>>>
>>> Otherwise please feel free to open an issue at the shoes4 repository:
>>> https://github.com/shoes/shoes4/issues
>>>
>>> It's something that we might want to do in a future release and it
>>> should be simple, however the first release is aimed at implementing
>>> all the features of the old shoes and I don't really want to add to
>>> that because I really WANT to release it. However it is open source so
>>> if you or someone else really wants to have that make a pull request
>>> (after we discuseed about DSL etc.) and I'd be happy to merge that in.
>>>
>>> Cheers,
>>> Tobi
>>>
>>> On Wed 25 Sep 2013 04:57:11 PM PDT, Douglas Allen wrote:
>>> > Hi Guys.
>>> >
>>> > Before we think this thing is ready for more public release could we
>>> > at least make sure there is either good documentation for this and or
>>> > some methods down in the lib. Half the fun of the old programs like
>>> > QBASIC and what have you were from being able to give x, y, color and
>>> > plot like matplot or better.
>>> > I miss those days. Seems anytime we want to do this we either have to
>>> > use some language we haven't learned yet like Python or C and get some
>>> > extra libs to do it with. Good ol BASIC, GWBASIC, COMMODORE BASIC, and
>>> > QBASIC had or has these routines built right in. I hate to see shoes
>>> > go away empty handed.
>>> >
>>> > Thanks.
>>> >
>>>
>>
>>
>

Re: [shoes] Pixel plotting

From:
Eric Watson
Date:
2013-09-26 @ 14:52
On Sep 26, 2013, at 9:32 AM, Douglas Allen <kb9agt@gmail.com> wrote:

> def point(x,y,color, bg_color)
>  stroke color
>  line x,y,x,y+1
>  stroke bg_color
>  line x,y+1,x+1,y+1
> end

Cool. I like the design! Here's another way to think of a point: as a very
small circle

# Keep the same interface as Douglas's example, but we don't need
# bg_color anymore :)
def point(x,y,color, bg_color = nil)
  oval x, y, 1, :fill => color
end

I think a point method would be a nice addition. 

Eric

Re: [shoes] Pixel plotting

From:
Douglas Allen
Date:
2013-09-26 @ 22:55
Well thanks Eric. I'm glad someone agrees with me. We're a small community
her and I'll bet if you ask around more folks would agree. Remember the
video __why did about the kid learning C and C++? Why make it tough. I bet
__why was frustrated about having to build it wrapping C libs in Ruby too.
We have so many. Fox, GTK, WX, Qt, SDL, OpenGL, and ones like Gosu,
Rubygame, and a host of others. What's my point? I dunno. Maybe it is
point. lol
Thanks.


On Thu, Sep 26, 2013 at 9:52 AM, Eric Watson <wasnotrice@gmail.com> wrote:

>
> On Sep 26, 2013, at 9:32 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>
> > def point(x,y,color, bg_color)
> >  stroke color
> >  line x,y,x,y+1
> >  stroke bg_color
> >  line x,y+1,x+1,y+1
> > end
>
> Cool. I like the design! Here's another way to think of a point: as a very
> small circle
>
> # Keep the same interface as Douglas's example, but we don't need
> # bg_color anymore :)
> def point(x,y,color, bg_color = nil)
>   oval x, y, 1, :fill => color
> end
>
> I think a point method would be a nice addition.
>
> Eric
>

Re: [shoes] Pixel plotting

From:
Douglas Allen
Date:
2013-09-26 @ 22:59
One more quick idea while we're on it. It could also use an attribute for
size as I had to fiddle with it to make it a bit bigger like so.

def point(x,y,color)#, bg_color)
 stroke color
 line x,y,x,y+1
 line x+1,y,x+1,y+1
 line x+2,y,x+2,y+1
 line x,y+1,x,y+2
 line x+1,y+1,x+1,y+2
 line x+2,y+1,x+2,y+2
 line x,y+2,x,y+3
 line x+1,y+2,x+1,y+3
 line x+2,y+2,x+2,y+3
 # stroke bg_color
 # line x,y+1,x+1,y+1
end

I haven't tried Eric's suggestion but I bet it would be just as easy.


On Thu, Sep 26, 2013 at 5:55 PM, Douglas Allen <kb9agt@gmail.com> wrote:

> Well thanks Eric. I'm glad someone agrees with me. We're a small community
> her and I'll bet if you ask around more folks would agree. Remember the
> video __why did about the kid learning C and C++? Why make it tough. I bet
> __why was frustrated about having to build it wrapping C libs in Ruby too.
> We have so many. Fox, GTK, WX, Qt, SDL, OpenGL, and ones like Gosu,
> Rubygame, and a host of others. What's my point? I dunno. Maybe it is
> point. lol
> Thanks.
>
>
> On Thu, Sep 26, 2013 at 9:52 AM, Eric Watson <wasnotrice@gmail.com> wrote:
>
>>
>> On Sep 26, 2013, at 9:32 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>>
>> > def point(x,y,color, bg_color)
>> >  stroke color
>> >  line x,y,x,y+1
>> >  stroke bg_color
>> >  line x,y+1,x+1,y+1
>> > end
>>
>> Cool. I like the design! Here's another way to think of a point: as a
>> very small circle
>>
>> # Keep the same interface as Douglas's example, but we don't need
>> # bg_color anymore :)
>> def point(x,y,color, bg_color = nil)
>>   oval x, y, 1, :fill => color
>> end
>>
>> I think a point method would be a nice addition.
>>
>> Eric
>>
>
>

Re: [shoes] Pixel plotting

From:
Douglas Allen
Date:
2013-09-26 @ 23:13
I know. That's extreme. But test first and refactor did it.

more like
def point(x,y,color, size)
 stroke color
 (0..size).each do |i|
  line x,y,x+size,y+i
 end

did the trick.


On Thu, Sep 26, 2013 at 5:59 PM, Douglas Allen <kb9agt@gmail.com> wrote:

> One more quick idea while we're on it. It could also use an attribute for
> size as I had to fiddle with it to make it a bit bigger like so.
>
> def point(x,y,color)#, bg_color)
>  stroke color
>  line x,y,x,y+1
>  line x+1,y,x+1,y+1
>  line x+2,y,x+2,y+1
>  line x,y+1,x,y+2
>  line x+1,y+1,x+1,y+2
>  line x+2,y+1,x+2,y+2
>  line x,y+2,x,y+3
>  line x+1,y+2,x+1,y+3
>  line x+2,y+2,x+2,y+3
>  # stroke bg_color
>  # line x,y+1,x+1,y+1
> end
>
> I haven't tried Eric's suggestion but I bet it would be just as easy.
>
>
> On Thu, Sep 26, 2013 at 5:55 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>> Well thanks Eric. I'm glad someone agrees with me. We're a small
>> community her and I'll bet if you ask around more folks would agree.
>> Remember the video __why did about the kid learning C and C++? Why make it
>> tough. I bet __why was frustrated about having to build it wrapping C libs
>> in Ruby too. We have so many. Fox, GTK, WX, Qt, SDL, OpenGL, and ones like
>> Gosu, Rubygame, and a host of others. What's my point? I dunno. Maybe it is
>> point. lol
>> Thanks.
>>
>>
>> On Thu, Sep 26, 2013 at 9:52 AM, Eric Watson <wasnotrice@gmail.com>wrote:
>>
>>>
>>> On Sep 26, 2013, at 9:32 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>>>
>>> > def point(x,y,color, bg_color)
>>> >  stroke color
>>> >  line x,y,x,y+1
>>> >  stroke bg_color
>>> >  line x,y+1,x+1,y+1
>>> > end
>>>
>>> Cool. I like the design! Here's another way to think of a point: as a
>>> very small circle
>>>
>>> # Keep the same interface as Douglas's example, but we don't need
>>> # bg_color anymore :)
>>> def point(x,y,color, bg_color = nil)
>>>   oval x, y, 1, :fill => color
>>> end
>>>
>>> I think a point method would be a nice addition.
>>>
>>> Eric
>>>
>>
>>
>

Re: [shoes] Pixel plotting

From:
Douglas Allen
Date:
2013-09-26 @ 23:35
That original is not my code as I said it was from a post on stackoverflow.
(stackexchange is the email notification) I think it was Steve even who
answered it. I don't know why the background part was in it. Maybe just a
shadow for contrast or something. Notice my code has a = width / height ?
That is for aspect ratio or you would get an oval. Something else that
would be handy. Just a thought.



On Thu, Sep 26, 2013 at 6:13 PM, Douglas Allen <kb9agt@gmail.com> wrote:

> I know. That's extreme. But test first and refactor did it.
>
> more like
> def point(x,y,color, size)
>  stroke color
>  (0..size).each do |i|
>   line x,y,x+size,y+i
>  end
>
> did the trick.
>
>
> On Thu, Sep 26, 2013 at 5:59 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>> One more quick idea while we're on it. It could also use an attribute for
>> size as I had to fiddle with it to make it a bit bigger like so.
>>
>> def point(x,y,color)#, bg_color)
>>  stroke color
>>  line x,y,x,y+1
>>  line x+1,y,x+1,y+1
>>  line x+2,y,x+2,y+1
>>  line x,y+1,x,y+2
>>  line x+1,y+1,x+1,y+2
>>  line x+2,y+1,x+2,y+2
>>  line x,y+2,x,y+3
>>  line x+1,y+2,x+1,y+3
>>  line x+2,y+2,x+2,y+3
>>  # stroke bg_color
>>  # line x,y+1,x+1,y+1
>> end
>>
>> I haven't tried Eric's suggestion but I bet it would be just as easy.
>>
>>
>> On Thu, Sep 26, 2013 at 5:55 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>>
>>> Well thanks Eric. I'm glad someone agrees with me. We're a small
>>> community her and I'll bet if you ask around more folks would agree.
>>> Remember the video __why did about the kid learning C and C++? Why make it
>>> tough. I bet __why was frustrated about having to build it wrapping C libs
>>> in Ruby too. We have so many. Fox, GTK, WX, Qt, SDL, OpenGL, and ones like
>>> Gosu, Rubygame, and a host of others. What's my point? I dunno. Maybe it is
>>> point. lol
>>> Thanks.
>>>
>>>
>>> On Thu, Sep 26, 2013 at 9:52 AM, Eric Watson <wasnotrice@gmail.com>wrote:
>>>
>>>>
>>>> On Sep 26, 2013, at 9:32 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>>>>
>>>> > def point(x,y,color, bg_color)
>>>> >  stroke color
>>>> >  line x,y,x,y+1
>>>> >  stroke bg_color
>>>> >  line x,y+1,x+1,y+1
>>>> > end
>>>>
>>>> Cool. I like the design! Here's another way to think of a point: as a
>>>> very small circle
>>>>
>>>> # Keep the same interface as Douglas's example, but we don't need
>>>> # bg_color anymore :)
>>>> def point(x,y,color, bg_color = nil)
>>>>   oval x, y, 1, :fill => color
>>>> end
>>>>
>>>> I think a point method would be a nice addition.
>>>>
>>>> Eric
>>>>
>>>
>>>
>>
>

Re: [shoes] Pixel plotting

From:
Douglas Allen
Date:
2013-09-26 @ 23:39
So if we are saying that shoes is for kids then why are we making things
like line and circle and stuff? Let them learn some math before it's too
late. I'm pro on shoes being a great teaching tool but not just for Ruby. K
guys?


On Thu, Sep 26, 2013 at 6:35 PM, Douglas Allen <kb9agt@gmail.com> wrote:

> That original is not my code as I said it was from a post on
> stackoverflow. (stackexchange is the email notification) I think it was
> Steve even who answered it. I don't know why the background part was in it.
> Maybe just a shadow for contrast or something. Notice my code has a = width
> / height ? That is for aspect ratio or you would get an oval. Something
> else that would be handy. Just a thought.
>
>
>
> On Thu, Sep 26, 2013 at 6:13 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>> I know. That's extreme. But test first and refactor did it.
>>
>> more like
>> def point(x,y,color, size)
>>  stroke color
>>  (0..size).each do |i|
>>   line x,y,x+size,y+i
>>  end
>>
>> did the trick.
>>
>>
>> On Thu, Sep 26, 2013 at 5:59 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>>
>>> One more quick idea while we're on it. It could also use an attribute
>>> for size as I had to fiddle with it to make it a bit bigger like so.
>>>
>>> def point(x,y,color)#, bg_color)
>>>  stroke color
>>>  line x,y,x,y+1
>>>  line x+1,y,x+1,y+1
>>>  line x+2,y,x+2,y+1
>>>  line x,y+1,x,y+2
>>>  line x+1,y+1,x+1,y+2
>>>  line x+2,y+1,x+2,y+2
>>>  line x,y+2,x,y+3
>>>  line x+1,y+2,x+1,y+3
>>>  line x+2,y+2,x+2,y+3
>>>  # stroke bg_color
>>>  # line x,y+1,x+1,y+1
>>> end
>>>
>>> I haven't tried Eric's suggestion but I bet it would be just as easy.
>>>
>>>
>>> On Thu, Sep 26, 2013 at 5:55 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>>>
>>>> Well thanks Eric. I'm glad someone agrees with me. We're a small
>>>> community her and I'll bet if you ask around more folks would agree.
>>>> Remember the video __why did about the kid learning C and C++? Why make it
>>>> tough. I bet __why was frustrated about having to build it wrapping C libs
>>>> in Ruby too. We have so many. Fox, GTK, WX, Qt, SDL, OpenGL, and ones like
>>>> Gosu, Rubygame, and a host of others. What's my point? I dunno. Maybe it is
>>>> point. lol
>>>> Thanks.
>>>>
>>>>
>>>> On Thu, Sep 26, 2013 at 9:52 AM, Eric Watson <wasnotrice@gmail.com>wrote:
>>>>
>>>>>
>>>>> On Sep 26, 2013, at 9:32 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>>>>>
>>>>> > def point(x,y,color, bg_color)
>>>>> >  stroke color
>>>>> >  line x,y,x,y+1
>>>>> >  stroke bg_color
>>>>> >  line x,y+1,x+1,y+1
>>>>> > end
>>>>>
>>>>> Cool. I like the design! Here's another way to think of a point: as a
>>>>> very small circle
>>>>>
>>>>> # Keep the same interface as Douglas's example, but we don't need
>>>>> # bg_color anymore :)
>>>>> def point(x,y,color, bg_color = nil)
>>>>>   oval x, y, 1, :fill => color
>>>>> end
>>>>>
>>>>> I think a point method would be a nice addition.
>>>>>
>>>>> Eric
>>>>>
>>>>
>>>>
>>>
>>
>

Re: [shoes] Pixel plotting

From:
Davor Babic
Date:
2013-09-27 @ 10:53
I like pixels and it shouldn't take more than a minute to hack together 
a quick implementation with what we've got, so I think that we should do it.

Basically just add "pixel = line with the width 1" to dsl.rb and we're 
done. It's a hack, but it works.
-- 
Davor Babic
davor@davor.se


Douglas Allen wrote:
> So if we are saying that shoes is for kids then why are we making things
> like line and circle and stuff? Let them learn some math before it's too
> late. I'm pro on shoes being a great teaching tool but not just for
> Ruby. K guys?
>
>
> On Thu, Sep 26, 2013 at 6:35 PM, Douglas Allen <kb9agt@gmail.com
> <mailto:kb9agt@gmail.com>> wrote:
>
>     That original is not my code as I said it was from a post on
>     stackoverflow. (stackexchange is the email notification) I think it
>     was Steve even who answered it. I don't know why the background part
>     was in it. Maybe just a shadow for contrast or something. Notice my
>     code has a = width / height ? That is for aspect ratio or you would
>     get an oval. Something else that would be handy. Just a thought.
>
>
>
>     On Thu, Sep 26, 2013 at 6:13 PM, Douglas Allen <kb9agt@gmail.com
>     <mailto:kb9agt@gmail.com>> wrote:
>
>         I know. That's extreme. But test first and refactor did it.
>
>         more like
>         def point(x,y,color, size)
>           stroke color
>           (0..size).each do |i|
>            line x,y,x+size,y+i
>           end
>
>         did the trick.
>
>
>         On Thu, Sep 26, 2013 at 5:59 PM, Douglas Allen <kb9agt@gmail.com
>         <mailto:kb9agt@gmail.com>> wrote:
>
>             One more quick idea while we're on it. It could also use an
>             attribute for size as I had to fiddle with it to make it a
>             bit bigger like so.
>
>             def point(x,y,color)#, bg_color)
>               stroke color
>               line x,y,x,y+1
>               line x+1,y,x+1,y+1
>               line x+2,y,x+2,y+1
>               line x,y+1,x,y+2
>               line x+1,y+1,x+1,y+2
>               line x+2,y+1,x+2,y+2
>               line x,y+2,x,y+3
>               line x+1,y+2,x+1,y+3
>               line x+2,y+2,x+2,y+3
>               # stroke bg_color
>               # line x,y+1,x+1,y+1
>             end
>
>             I haven't tried Eric's suggestion but I bet it would be just
>             as easy.
>
>
>             On Thu, Sep 26, 2013 at 5:55 PM, Douglas Allen
>             <kb9agt@gmail.com <mailto:kb9agt@gmail.com>> wrote:
>
>                 Well thanks Eric. I'm glad someone agrees with me. We're
>                 a small community her and I'll bet if you ask around
>                 more folks would agree. Remember the video __why did
>                 about the kid learning C and C++? Why make it tough. I
>                 bet __why was frustrated about having to build it
>                 wrapping C libs in Ruby too. We have so many. Fox, GTK,
>                 WX, Qt, SDL, OpenGL, and ones like Gosu, Rubygame, and a
>                 host of others. What's my point? I dunno. Maybe it is
>                 point. lol
>                 Thanks.
>
>
>                 On Thu, Sep 26, 2013 at 9:52 AM, Eric Watson
>                 <wasnotrice@gmail.com <mailto:wasnotrice@gmail.com>> wrote:
>
>
>                     On Sep 26, 2013, at 9:32 AM, Douglas Allen
>                     <kb9agt@gmail.com <mailto:kb9agt@gmail.com>> wrote:
>
>                      > def point(x,y,color, bg_color)
>                      >  stroke color
>                      >  line x,y,x,y+1
>                      >  stroke bg_color
>                      >  line x,y+1,x+1,y+1
>                      > end
>
>                     Cool. I like the design! Here's another way to think
>                     of a point: as a very small circle
>
>                     # Keep the same interface as Douglas's example, but
>                     we don't need
>                     # bg_color anymore :)
>                     def point(x,y,color, bg_color = nil)
>                        oval x, y, 1, :fill => color
>                     end
>
>                     I think a point method would be a nice addition.
>
>                     Eric
>
>
>
>
>
>

Re: [shoes] Pixel plotting

From:
Tobias Pfeiffer
Date:
2013-09-30 @ 17:56
Personally I'd much rather implement it the right way and not build up 
additional technical debt. E.g. There probably is some SWT Point 
representation and use that.

Cheers,
Tobi

On Fri 27 Sep 2013 03:53:09 AM PDT, Davor Babic wrote:
> I like pixels and it shouldn't take more than a minute to hack together
> a quick implementation with what we've got, so I think that we should do it.
>
> Basically just add "pixel = line with the width 1" to dsl.rb and we're
> done. It's a hack, but it works.

Re: [shoes] Pixel plotting

From:
Eric Watson
Date:
2013-09-30 @ 18:27
On Sep 30, 2013, at 12:56 PM, Tobias Pfeiffer 
<tobias.pfeiffer@student.hpi.uni-potsdam.de> wrote:

> E.g. There probably is some SWT Point 
> representation and use that.

GC.drawPoint(x, y)

Re: [shoes] Pixel plotting

From:
Tobias Pfeiffer
Date:
2013-09-27 @ 00:17
One of the points of it being for kids (among other things) is that it 
should be easy and fun to do things. That's why we have them. Beaides I 
use shoes quite a bit myself to build me convenience programs and have fun
:-)
Sent from my mobile - Sorry for the brevity

Douglas Allen <kb9agt@gmail.com> wrote:

>So if we are saying that shoes is for kids then why are we making things 
like line and circle and stuff? Let them learn some math before it's too 
late. I'm pro on shoes being a great teaching tool but not just for Ruby. 
K guys?
>
>
>
>On Thu, Sep 26, 2013 at 6:35 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>That original is not my code as I said it was from a post on 
stackoverflow. (stackexchange is the email notification) I think it was 
Steve even who answered it. I don't know why the background part was in 
it. Maybe just a shadow for contrast or something. Notice my code has a = 
width / height ? That is for aspect ratio or you would get an oval. 
Something else that would be handy. Just a thought.
>
>
>
>
>On Thu, Sep 26, 2013 at 6:13 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>I know. That's extreme. But test first and refactor did it.
>
>
>more like
>
>def point(x,y,color, size)
>
> stroke color
>
> (0..size).each do |i|
>
>  line x,y,x+size,y+i
>
> end
>
>
>did the trick.
>
>
>
>On Thu, Sep 26, 2013 at 5:59 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>One more quick idea while we're on it. It could also use an attribute for
size as I had to fiddle with it to make it a bit bigger like so.
>
>
>def point(x,y,color)#, bg_color)
>
> stroke color
>
> line x,y,x,y+1
>
> line x+1,y,x+1,y+1
>
> line x+2,y,x+2,y+1
>
> line x,y+1,x,y+2
>
> line x+1,y+1,x+1,y+2
>
> line x+2,y+1,x+2,y+2
>
> line x,y+2,x,y+3
>
> line x+1,y+2,x+1,y+3
>
> line x+2,y+2,x+2,y+3
>
> # stroke bg_color
>
> # line x,y+1,x+1,y+1
>
>end
>
>
>I haven't tried Eric's suggestion but I bet it would be just as easy.
>
>
>
>On Thu, Sep 26, 2013 at 5:55 PM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>Well thanks Eric. I'm glad someone agrees with me. We're a small 
community her and I'll bet if you ask around more folks would agree. 
Remember the video __why did about the kid learning C and C++? Why make it
tough. I bet __why was frustrated about having to build it wrapping C libs
in Ruby too. We have so many. Fox, GTK, WX, Qt, SDL, OpenGL, and ones like
Gosu, Rubygame, and a host of others. What's my point? I dunno. Maybe it 
is point. lol
>
>Thanks.
>
>
>
>On Thu, Sep 26, 2013 at 9:52 AM, Eric Watson <wasnotrice@gmail.com> wrote:
>
>
>On Sep 26, 2013, at 9:32 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>> def point(x,y,color, bg_color)
>>  stroke color
>>  line x,y,x,y+1
>>  stroke bg_color
>>  line x,y+1,x+1,y+1
>> end
>
>Cool. I like the design! Here's another way to think of a point: as a 
very small circle
>
># Keep the same interface as Douglas's example, but we don't need
># bg_color anymore :)
>def point(x,y,color, bg_color = nil)
>  oval x, y, 1, :fill => color
>end
>
>I think a point method would be a nice addition.
>
>Eric
>
>
>
>
>
>

Re: [shoes] Pixel plotting

From:
Tobias Pfeiffer
Date:
2013-09-26 @ 15:35
At the moment I just don't get why a point needs 2 colors - can you help 
me out here?
Tobi
Sent from my mobile - Sorry for the brevity

Eric Watson <wasnotrice@gmail.com> wrote:

>
>On Sep 26, 2013, at 9:32 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>> def point(x,y,color, bg_color)
>>  stroke color
>>  line x,y,x,y+1
>>  stroke bg_color
>>  line x,y+1,x+1,y+1
>> end
>
>Cool. I like the design! Here's another way to think of a point: as a 
very small circle
>
># Keep the same interface as Douglas's example, but we don't need
># bg_color anymore :)
>def point(x,y,color, bg_color = nil)
>  oval x, y, 1, :fill => color
>end
>
>I think a point method would be a nice addition. 
>
>Eric