Click here to Skip to main content
16,014,734 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to recive mail from POP3 Server in VB.Net 2005? Pin
hgs24shravgi19-Oct-07 20:38
hgs24shravgi19-Oct-07 20:38 
AnswerRe: How to recive mail from POP3 Server in VB.Net 2005? Pin
MidwestLimey22-Oct-07 12:43
professionalMidwestLimey22-Oct-07 12:43 
QuestionTechnology Conference Registration, need help Pin
jesseax19-Oct-07 16:52
jesseax19-Oct-07 16:52 
AnswerRe: Technology Conference Registration, need help Pin
Scott Dorman19-Oct-07 18:18
professionalScott Dorman19-Oct-07 18:18 
GeneralRe: Technology Conference Registration, need help Pin
jesseax21-Oct-07 17:14
jesseax21-Oct-07 17:14 
Questionusing ErrorProvider in VB HELP!! [modified] Pin
vbDigger'z19-Oct-07 16:13
vbDigger'z19-Oct-07 16:13 
QuestionProblems with Tic Tac Toe game in VB 2005 Pin
JeffMonty19-Oct-07 15:27
JeffMonty19-Oct-07 15:27 
AnswerRe: Problems with Tic Tac Toe game in VB 2005 Pin
Luc Pattyn19-Oct-07 16:12
sitebuilderLuc Pattyn19-Oct-07 16:12 
Hi,

without arrays, you will need a lot of code since there are 8 positions where you
can have a win (3 rows, 3 cols, 2 diags).

I would suggest a single, linear, array layed out like this:
0 1 2
3 4 5
6 7 8


containing say integers (0=empty, 1=player 1, 2=player 2)

Note: or characters (' '=empty, 'X'=player 1, 'O'=player 2)

Then recognizing a win after player N moved(=1 or 2, or 'X'/'O'), is looking
for three values N at three array positions with

start index = 0 3 6 0 1 2 0 2
index incr  = 1 1 1 3 3 3 4 2


which themselves can also be kept in two arrays,
hence a simple for loop over these 8 possibilities would do it.

Note that I separate the GUI parts (textboxes, whatever) from the game logic!

Smile | :)



Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google


AnswerRe: Problems with Tic Tac Toe game in VB 2005 Pin
bapu288921-Oct-07 7:57
bapu288921-Oct-07 7:57 
QuestionCan we convert Visual Studio VB to Visual Studio C++? Pin
ATC19-Oct-07 10:11
ATC19-Oct-07 10:11 
AnswerRe: Can we convert Visual Studio VB to Visual Studio C++? Pin
Dave Doknjas19-Oct-07 14:24
Dave Doknjas19-Oct-07 14:24 
QuestionRe: Can we convert Visual Studio VB to Visual Studio C++? Pin
Hamid_RT21-Oct-07 4:59
Hamid_RT21-Oct-07 4:59 
QuestionWCF Problem Pin
RobBlu19-Oct-07 8:47
RobBlu19-Oct-07 8:47 
AnswerSorry, I forgot the app.config Pin
RobBlu19-Oct-07 8:53
RobBlu19-Oct-07 8:53 
Questionproblem in deployment Pin
Shuaib wasif khan19-Oct-07 8:04
Shuaib wasif khan19-Oct-07 8:04 
AnswerRe: problem in deployment Pin
svanwass19-Oct-07 9:16
svanwass19-Oct-07 9:16 
AnswerRe: problem in deployment Pin
Scott Dorman19-Oct-07 9:23
professionalScott Dorman19-Oct-07 9:23 
GeneralRe: problem in deployment Pin
svanwass19-Oct-07 9:26
svanwass19-Oct-07 9:26 
QuestionVB.NET 2005 ODBCCommand Pin
rahvyn619-Oct-07 5:52
rahvyn619-Oct-07 5:52 
AnswerRe: VB.NET 2005 ODBCCommand Pin
Kschuler19-Oct-07 8:22
Kschuler19-Oct-07 8:22 
GeneralRe: VB.NET 2005 ODBCCommand Pin
rahvyn619-Oct-07 8:39
rahvyn619-Oct-07 8:39 
AnswerRe: Help usinf hiddenfield control and dropdownlist Pin
nlarson1119-Oct-07 6:38
nlarson1119-Oct-07 6:38 
QuestionReportviewer does not print landscape Pin
dptalt19-Oct-07 5:34
dptalt19-Oct-07 5:34 
QuestionFTP folderlist [modified] Pin
Tom Deketelaere19-Oct-07 3:53
professionalTom Deketelaere19-Oct-07 3:53 
QuestionOnly download if newer version available? Pin
Brad^19-Oct-07 3:41
Brad^19-Oct-07 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.