POV-Ray : Newsgroups : povray.newusers : Expected 'operator', ? found instead : Re: Expected 'operator', ? found instead Server Time
28 Jul 2024 14:26:12 EDT (-0400)
  Re: Expected 'operator', ? found instead  
From: Mathuin
Date: 5 Oct 2008 04:40:00
Message: <web.48e87d0f38f591c7d8a103ef0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
\> The syntax inside functions is different from that of the main SDL. It
> doesn't have "?" but it does have "select".

I ended up making a macro instead of a function.

'white_stone' is 'stone(1, 1, 1)' and 'black_stone' is 'stone(0, 0, 0)' so I
have this which works:

#macro ScoreStone(i)
stone(i ? 1 : 0, i ? 1 : 0, i ? 1 : 0)
#end // macro ScoreStone(i)

It's kinda ugly, but it definitely works.

Thank you for the pointer to select() -- I will use that in the future.

>
> --
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.