> Steve Wampler wrote:
> > This looks like fun.
>
> After actually visiting the RC site, how about this solution?:
>
> procedure main()
> while (10 ~= write(?20 - 1), write(?20 - 1))
> end
>
> which shows the power of GDE without introducing the
> repeated evaluation operation. Or just:
>
> procedure main()
> while (10 ~= write(?20 - 1)) & write(?20 - 1)
> end
>
> [I personally prefer the first, but it does introduce
> another 'new' operation.]
These would make sense as illustrated alternatives if Rosetta encourages that,
but it seems the plan of this site is to solve a specific task in a specific
way. Depends on how /essential/ it is to have the "break" operator as part of
the solution; it is asking for a loop with a break...
Interesting now the question (this particular one) is couched in terms that
make sense for "ordinary" languages. If the question was to NOT print the
first number if it's found to be 10, it would be even easier
while write(10 ~= ?20 - 1, "\n", ?20 - 1)
Funny how language influences the sort of question you think to ask!
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group