POV-Ray : Newsgroups : povray.off-topic : You lose some... : Re: You lose some... Server Time
7 Sep 2024 03:22:00 EDT (-0400)
  Re: You lose some...  
From: Orchid XP v8
Date: 5 Oct 2008 08:55:38
Message: <48e8b94a$1@news.povray.org>
Chris Cason wrote:

> If he wants brevity he could also code it like this:
> 
>   for (int i = 0; i < c.size(); i++)
>     out.append(c[i] ? "1" : "0");
> 
> which is just as valid and avoids running the if/else together.

Ooo, I like that. (It makes it clear that append() is always called, and 
it's only the argument that changes depending on c[i].)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

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