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 Four consecutive pattern program

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 03-13-2011, 05:58 AM PM User | #1 plasmastar New to the CF scene   Join Date: Mar 2011 Posts: 2 Thanks: 0 Thanked 0 Times in 0 Posts Four consecutive pattern program Hi all! I'm trying to make a program in Java that does the following: The user first enters number of rows and columns for a "table". Then a two dimensional array is created using the amount of rows and columns for each dimension respectively. This array is then filled with numbers. For the time being, I am generating random numbers from 0 to 9 to fill the array. Up to this point, I'm having no problems. Now, here's the good part. After filling the array, the program is supposed to tell you if there are any four consecutive same numbers in the array, be it horizontally, vertically or diagonally. I'm having a hard time finding a logic that could work for this program, but every time I think of something it doesn't work. Recently I made a console TicTacToe game in Java, and I assume that the logic for this program is similar to the one I used in the game, but the difference is that the TicTacToe array is 3X3 constant, plus you only have two characters to check: "X" and "O". Whereas in this program, you can have any number, and any size of array. Any help that you can provide me will be greatly appreciated, as I've kept trying to find an answer to this but have been unsuccessful.
 03-14-2011, 01:54 AM PM User | #2 plasmastar New to the CF scene   Join Date: Mar 2011 Posts: 2 Thanks: 0 Thanked 0 Times in 0 Posts I've managed to do the main diagonal in the middle for both cases (/ and \) however I still can't find a way to do the diagonals above and below the main diagonals.

 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 08:41 AM.