What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Shorter code for this? :S

Shorter code for this? :S
Author: Message:
albert
Veteran Member
*****

Avatar

Posts: 2247
Reputation: 42
– / Male / Flag
Joined: Feb 2005
O.P. Shorter code for this? :S
I have a little problem with this code.

Basicly it's a array (I think that's how it's called in english, in french it's tableau, well it's some kind of table for programming that you can put date in..)

Anyhow, I'm doing this Othello game, and I'm quite sure there's an easier way to code this, but I can't seem to find a solution.

Here's the current code :

code:
for ( compteurColonnes = 0 ; compteurColonnes < 10 ; compteurColonnes ++ )
            for ( compteurRangees = 0 ; compteurRangees < 10 ; compteurRangees ++)
                othellier[compteurColonnes][compteurRangees]= '~' ;
       
        othellier[0][0]= ' ' ;
        othellier[0][1]= 'A' ;
        othellier[0][2]= 'B' ;
        othellier[0][3]= 'C' ;
        othellier[0][4]= 'D' ;
        othellier[0][5]= 'E' ;
        othellier[0][6]= 'F' ;
        othellier[0][7]= 'G' ;
        othellier[0][8]= 'H' ;
        othellier[0][9]= ' ' ;
       
        othellier[9][0]= ' ' ;
        othellier[9][1]= 'A' ;
        othellier[9][2]= 'B' ;
        othellier[9][3]= 'C' ;
        othellier[9][4]= 'D' ;
        othellier[9][5]= 'E' ;
        othellier[9][6]= 'F' ;
        othellier[9][7]= 'G' ;
        othellier[9][8]= 'H' ;
        othellier[9][9]= ' ' ;
       
        othellier[0][0]= ' ' ;
        othellier[1][0]= '1' ;
        othellier[2][0]= '2' ;
        othellier[3][0]= '3' ;
        othellier[4][0]= '4' ;
        othellier[5][0]= '5' ;
        othellier[6][0]= '6' ;
        othellier[7][0]= '7' ;
        othellier[8][0]= '8' ;
        othellier[9][0]= ' ' ;
       
        othellier[0][9]= ' ' ;
        othellier[1][9]= '1' ;
        othellier[2][9]= '2' ;
        othellier[3][9]= '3' ;
        othellier[4][9]= '4' ;
        othellier[5][9]= '5' ;
        othellier[6][9]= '6' ;
        othellier[7][9]= '7' ;
        othellier[8][9]= '8' ;
        othellier[9][9]= ' ' ;


the code is in java, but i think anyone with a little programming skills can understand it

and i have tried making a few "for"s with the numbers.. but the problem is that the array in "char" since I have to represent black by * and white by -

so.. yeah,.. anyhelp would be appreciated.
02-11-2007 04:16 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Shorter code for this? :S - by albert on 02-11-2007 at 04:16 PM
RE: Shorter code for this? :S - by Jesus on 02-11-2007 at 04:29 PM
RE: Shorter code for this? :S - by albert on 02-11-2007 at 04:34 PM
RE: Shorter code for this? :S - by vikke on 02-11-2007 at 05:56 PM
RE: Shorter code for this? :S - by RaceProUK on 02-11-2007 at 09:53 PM
RE: Shorter code for this? :S - by vikke on 02-12-2007 at 11:16 AM
RE: Shorter code for this? :S - by RaceProUK on 02-13-2007 at 04:59 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On