Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2013, 05:33 PM
Registered User
 
Join Date: Apr 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch04Ex06

I am having trouble with the fractal image the author has provided us with. I have downloaded the code and I got the same results. After each character there is a line break so it does not show the entire image only a column of characters. This is for Beginning Visual C# 2012 Programming book. Thanks to anyone who thinks they have an answer or has seen this before.
 
Old May 23rd, 2013, 02:58 PM
Registered User
 
Join Date: May 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was having the same issue as well and the reason was this was what I had in the last section of code:

Code:
switch (iterations % 4)
                    {
                        case 0:
                            Console.WriteLine(".");
                            break;
                        case 1:
                            Console.WriteLine("o");
                            break;
                        case 2:
                            Console.WriteLine("O");
                            break;
                        case 3:
                            Console.WriteLine("@");
                            break;
                    }
                }
                Console.WriteLine("\n");
and it should have been this:

Code:
switch (iterations % 4)
                    {
                        case 0:
                            Console.Write(".");
                            break;
                        case 1:
                            Console.Write("o");
                            break;
                        case 2:
                            Console.Write("O");
                            break;
                        case 3:
                            Console.Write("@");
                            break;
                    }
                }
                Console.Write("\n");
So by changing from WriteLine to Write I was able to get the image from the book. Hope this helps solve your problem as well. :)









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.