Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Help!

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 04-25-2004, 03:26 PM PM User | #1 wargis New to the CF scene   Join Date: Apr 2004 Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts Help! g'day peoples, im new to these forums and to the coding world so be nice. using c++ here, ive got to draw a grid 9x9 and place a star in the middle. I can draw the grid, but the bloody star keeps appearing at the bottom, heres my code, thx for the help. ----- #include void main () { int column=0; int row=0; int x=5; int y=5; for (column=0; column <9;column ++) {int column=0; for (row=0; row <19; row ++) cout <<"-"; cout << endl; for (row=0; row <10; row++) cout << "| "; cout << endl;} for (row=0; row <19; row ++) cout <<"-"; cout << endl; for (int row=0; row <19; ++row) {cout <
 04-26-2004, 07:50 PM PM User | #2 Unit Regular Coder   Join Date: Feb 2004 Location: WA Posts: 213 Thanks: 0 Thanked 0 Times in 0 Posts That is happening because you already drew the grid. There are two ways to deal with this. - print the asterisk while you are making the grid. start drawing the grid and when you detect that you are at the middle of the grid, draw the asterisk and continue with the grid. - print the asterisk by using console gotoxy functions. the first method is very portable in the sense that you can even redirect the output the printer and the asterisk would still be in the middle of the grid. btw, your code is very confusing.. for example Code: ```for (column=0; column <9;column ++) {int column=0;``` It is a very bad programming practice to use overlapping scopes for variables. besides you are not even using that variable inside the loop! Try to implement my first suggestion. You will need to go with the second method if you are writing something interactive like a game. __________________ Nobody is Perfect. I am Nobody.
 04-26-2004, 09:42 PM PM User | #3 Spookster Supreme Overlord     Join Date: May 2002 Location: Marion, IA USA Posts: 6,264 Thanks: 4 Thanked 83 Times in 82 Posts ^ This looks very much like a homework assignment. Professors like to give this type of problem out as homework. wargis, In the future you need to read our posting guidelines regarding proper titles of threads. __________________ Spookster CodingForums Supreme Overlord All Hail Spookster
 04-26-2004, 09:44 PM PM User | #4 Unit Regular Coder   Join Date: Feb 2004 Location: WA Posts: 213 Thanks: 0 Thanked 0 Times in 0 Posts That's the reason I tried to point him in the right direction and not feed him with full blown code __________________ Nobody is Perfect. I am Nobody.

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 06:15 PM.