C# String - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Programming
Click Here to Login
Reply
 
Thread Tools Display Modes
 
Old 11-28-2013, 10:21 AM   #1 (permalink)
Newb Techie
 
Join Date: Oct 2013
Location: UK
Posts: 10
Default C# String

People, I need some help with using string to make a game board for chess, or in fact any board it.

The idea I have is that the board needs to be represented as string and use strings to find out elements and insert the piece and so on. Need some help on this though since my programming isn't all that great. It's going to be written in C#

Can any of you give me a hand. Thanks
__________________

Ru Ru is offline   Reply With Quote
Old 12-02-2013, 12:35 PM   #2 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,515
Default Re: C# String

Sounds a bit like a homework assignment.

Do you have a specific question about implementing with strings?

Maybe use a List<string> or array of strings.
__________________

__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Samsung Galaxy Note 5


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Old 12-04-2013, 01:40 PM   #3 (permalink)
Newb Techie
 
Join Date: Aug 2013
Location: United States of America
Posts: 15
Default Re: C# String

Quote:
Originally Posted by Ru Ru View Post
People, I need some help with using string to make a game board for chess, or in fact any board it.

The idea I have is that the board needs to be represented as string and use strings to find out elements and insert the piece and so on. Need some help on this though since my programming isn't all that great. It's going to be written in C#

Can any of you give me a hand. Thanks
Can you be a little more specific? Like is it going to be graphical or just lines and letters representing the pieces or what exactly?
mike_branco is offline   Reply With Quote
Old 12-04-2013, 01:45 PM   #4 (permalink)
 
iFargle's Avatar
 
Join Date: Jan 2009
Location: United States
Posts: 4,028
Default Re: C# String

Quote:
Originally Posted by carnageX View Post
Sounds a bit like a homework assignment.

Do you have a specific question about implementing with strings?

Maybe use a List<string> or array of strings.
This.
Personally I'd use a 2-D array because it's easier to visualize for me.. However, the more dimensions you have, the more complicated it is to pass between functions... pointers to pointers (ad infinitum, depending on how many dimensions you have)
__________________
7700k 32GB RAM 512GB 960 Pro GTX 1080 NCase M1
15" Retina MBP || 64GB Nexus 6P || 64GB iPad Air 2
Battle.net: iFargle #1561 || Steam/Origin: iFargle
iFargle is offline   Reply With Quote
Old 12-04-2013, 03:22 PM   #5 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,515
Default Re: C# String

Quote:
Originally Posted by iFargle View Post
This.
Personally I'd use a 2-D array because it's easier to visualize for me.. However, the more dimensions you have, the more complicated it is to pass between functions... pointers to pointers (ad infinitum, depending on how many dimensions you have)
C# doesn't have pointers (well it does... but technically everything is already a pointer).

Arrays? Psh, Lists are where it's at!

Fun when you have List<List<string>> haha.
__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Samsung Galaxy Note 5


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Old 12-04-2013, 03:26 PM   #6 (permalink)
Newb Techie
 
Join Date: Aug 2013
Location: United States of America
Posts: 15
Default Re: C# String

Quote:
Originally Posted by carnageX View Post
Fun when you have List<List<string>> haha.
Fun?!...Try horrible hahaha
mike_branco is offline   Reply With Quote
Old 12-04-2013, 03:29 PM   #7 (permalink)
 
iFargle's Avatar
 
Join Date: Jan 2009
Location: United States
Posts: 4,028
Default Re: C# String

List<List<List<List<List<List<string>>>>>>
How would that even work...
__________________
7700k 32GB RAM 512GB 960 Pro GTX 1080 NCase M1
15" Retina MBP || 64GB Nexus 6P || 64GB iPad Air 2
Battle.net: iFargle #1561 || Steam/Origin: iFargle
iFargle is offline   Reply With Quote
Old 12-04-2013, 03:30 PM   #8 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,515
Default Re: C# String

Quote:
Originally Posted by mike_branco View Post
Fun?!...Try horrible hahaha
I've had to do it before lol. It's not too bad when using Visual Studio... just interesting to keep track of which list you're actually interacting with lol. Not much different from a 2D array though honestly... IMO it's easier to manage data since it's dynamic and you can add/remove elements at will.

But that's just me .
__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Samsung Galaxy Note 5


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Old 12-04-2013, 03:40 PM   #9 (permalink)
Newb Techie
 
Join Date: Aug 2013
Location: United States of America
Posts: 15
Default Re: C# String

Quote:
Originally Posted by carnageX View Post
I've had to do it before lol. It's not too bad when using Visual Studio... just interesting to keep track of which list you're actually interacting with lol. Not much different from a 2D array though honestly... IMO it's easier to manage data since it's dynamic and you can add/remove elements at will.

But that's just me .
Yeah I believe that. lol a lot of programming is "ugly" but there is no way around it most of the time haha
mike_branco is offline   Reply With Quote
Old 12-05-2013, 01:58 PM   #10 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,515
Default Re: C# String

Quote:
Originally Posted by mike_branco View Post
Yeah I believe that. lol a lot of programming is "ugly" but there is no way around it most of the time haha
Can sometimes be ugly if you don't format things right.

I've written some pretty code before lol.
__________________

__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Samsung Galaxy Note 5


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 01:55 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.