Re: questions, questions; always questions :)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Carl R. White wrote:
> Add some code and change the if statement like so:
> function alltrue(sequence of_conditions)
>     return not find(False, of_conditions)
> end function
> if alltrue(x<MaxX) and alltrue(y<MaxX) and
>    alltrue(x>=0)   and alltrue(y>=0)   then
>    plot(x,y,GREEN)
> end if
another elegant solution... gotta admit i had to
read that one a couple times to 'catch it'...heh
'course, i've only had 1 cup o'java tis morn'

>To be honest though, does the plot() statement
>really work like that?
well, the plot() function doesn't exist as a
standard euphoria function, it would have
to be made.  I was just trying to provide
an inherently intuitive pseudo-function that
all of us would immediately know what the
function did. to specify:
   procedure plot(sequence x, sequence y, atom clr)
   --assumes x & y are both equal length sequences
   --containing valid points on the user graphic screen
   --note: this is prolly not the best implementation of
   --      this function...
        for index = 1 to length(x) do
                pixel(clr,{x[index],y[index])
        end for
   end procedure

> The function allfalse()
function allfalse(sequence conditions)
   return not find(TRUE,conditions)
end function
:)

>and how to use "*not* allwhatever()" are left as
>exercises to the Euphoria community :)
don't get that one... :(

take care all, and hope you get back online carl--Hawke'

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu