Click here to Skip to main content
15,913,941 members
Home / Discussions / C#
   

C#

 
AnswerRe: Change Content of Button Pin
Pete O'Hanlon11-Nov-13 10:32
mvePete O'Hanlon11-Nov-13 10:32 
GeneralRe: Change Content of Button Pin
Member 1037988611-Nov-13 11:00
Member 1037988611-Nov-13 11:00 
GeneralRe: Change Content of Button Pin
Pete O'Hanlon11-Nov-13 11:18
mvePete O'Hanlon11-Nov-13 11:18 
Questionc# - Cinema system - Noob need help - 2d arrray - Pin
cSharpDonkey11-Nov-13 4:21
cSharpDonkey11-Nov-13 4:21 
AnswerRe: c# - Cinema system - Noob need help - 2d arrray - Pin
GuyThiebaut11-Nov-13 4:42
professionalGuyThiebaut11-Nov-13 4:42 
AnswerRe: c# - Cinema system - Noob need help - 2d arrray - Pin
Pete O'Hanlon11-Nov-13 4:43
mvePete O'Hanlon11-Nov-13 4:43 
AnswerRe: c# - Cinema system - Noob need help - 2d arrray - Pin
OriginalGriff11-Nov-13 5:18
mveOriginalGriff11-Nov-13 5:18 
AnswerRe: c# - Cinema system - Noob need help - 2d arrray - Pin
V.11-Nov-13 20:18
professionalV.11-Nov-13 20:18 
There must be a hundred ways in doing this. Just to give you an alternative of what you're doing.

The indexes of the array are already the row/seat number so there is no use in putting in a number in the array indicating this. Instead use a boolean. (true = taken, false = free)

Booking certain seats is then just like:
C#
pladser[10, 12] = true;  //booked row 11 seat 13.

For random assignment use the Random class with minimum = 0 and maximum the number of rows (or seats)

Some things to watch out for:
1. if a seat is taken you can't take it again. So take appropriate action.
2. Few people go alone to the movies and they want to sit next to one another if possible so in that case you end up checking multiple seats before assigning.

If you're working with a console application leave out the colors. You could use 'x' and 'o' for example.
Make sure in the output that it is clear to the user wat x, o or green/red mean.

Hope this helps.

Questionsubtract list first element with second one,third with secon one an so on Pin
Member 1038120910-Nov-13 22:57
Member 1038120910-Nov-13 22:57 
AnswerRe: subtract list first element with second one,third with secon one an so on Pin
OriginalGriff10-Nov-13 23:05
mveOriginalGriff10-Nov-13 23:05 
GeneralRe: subtract list first element with second one,third with secon one an so on Pin
Member 1038120910-Nov-13 23:14
Member 1038120910-Nov-13 23:14 
GeneralRe: subtract list first element with second one,third with secon one an so on Pin
Pete O'Hanlon10-Nov-13 23:26
mvePete O'Hanlon10-Nov-13 23:26 
GeneralRe: subtract list first element with second one,third with secon one an so on Pin
Member 1038120910-Nov-13 23:32
Member 1038120910-Nov-13 23:32 
GeneralRe: subtract list first element with second one,third with secon one an so on Pin
Pete O'Hanlon10-Nov-13 23:47
mvePete O'Hanlon10-Nov-13 23:47 
GeneralRe: subtract list first element with second one,third with secon one an so on Pin
Member 1038120911-Nov-13 0:16
Member 1038120911-Nov-13 0:16 
GeneralRe: subtract list first element with second one,third with secon one an so on Pin
Pete O'Hanlon11-Nov-13 0:21
mvePete O'Hanlon11-Nov-13 0:21 
GeneralRe: subtract list first element with second one,third with secon one an so on Pin
Richard MacCutchan11-Nov-13 3:37
mveRichard MacCutchan11-Nov-13 3:37 
GeneralRe: subtract list first element with second one,third with secon one an so on Pin
OriginalGriff10-Nov-13 23:35
mveOriginalGriff10-Nov-13 23:35 
QuestionImport Dll in the Application Pin
Member 913191910-Nov-13 20:23
Member 913191910-Nov-13 20:23 
AnswerRe: Import Dll in the Application Pin
Abhinav S10-Nov-13 20:40
Abhinav S10-Nov-13 20:40 
AnswerRe: Import Dll in the Application Pin
Alan Balkany14-Nov-13 4:49
Alan Balkany14-Nov-13 4:49 
Questioninstaller for window form application c# 4.0,2010 Pin
Member 1026351910-Nov-13 19:58
Member 1026351910-Nov-13 19:58 
AnswerRe: installer for window form application c# 4.0,2010 Pin
thatraja10-Nov-13 20:07
professionalthatraja10-Nov-13 20:07 
AnswerRe: installer for window form application c# 4.0,2010 Pin
Abhinav S10-Nov-13 21:12
Abhinav S10-Nov-13 21:12 
GeneralRe: installer for window form application c# 4.0,2010 Pin
Member 1026351913-Nov-13 0:51
Member 1026351913-Nov-13 0:51 

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.