Search Results

Search found 3 results on 1 pages for 'maxis'.

Page 1/1 | 1 

  • With which class to start Test Driven Development of card game application? And what would be the next 5 to 7 tests?

    - by Maxis
    I have started to write card game applications. Some model classes: CardSuit, CardValue, Card Deck, IDeckCreator, RegularDeckCreator, DoubleDeckCreator Board Hand and some game classes: Turn, TurnHandler IPlayer, ComputerPlayer, HumanPlayer IAttackStrategy, SimpleAttachStrategy, IDefenceStrategy, SimpleDefenceStrategy GameData, Game are already written. My idea is to create engine, where two computer players could play game and then later I could add UI part. Already for some time I'm reading about Test Driven Development (TDD) and I have idea to start writing application from scratch, as currently I have tendency to write not needed code, which seems usable in future. Also code doesn't have any tests and it is hard to add them now. Seems that TDD could improve all these issue - minimum of needed code, good test coverage and also could help to come to right application design. But I have one issue - I can't decide from where to start TDD? Should I start from bottom - Card related classes or somewhere on top - Game, TurnHandler, ... ? With which class you would start? And what would be the next 5 to 7 tests? (use the card game you know the best) I would like to start TDD with your help and then continue on my own!

    Read the article

  • How do I run Sim City 4?

    - by Jacob Larson
    I know that it is possible to run Sim City 4 Deluxe, as this page clearly proves so. http://appdb.winehq.org/objectManager.php?sClass=version&iId=10515 I have tried two different commands, and the paths are all right, but when I enter them, I simply get a blank terminal line. WINEDEUB=-all wine C:\\Program\ Files\ \(x86\)\\Maxis\\SimCity\ 4\ Deluxe\\Apps\\SimCity\ 4.exe -d:software -intro:off -CPUCount:1 env WINEPREFIX="/home/jacob/.wine" wine "C:\Program Files (x86)\Maxis\SimCity 4 Deluxe\Apps\SimCity 4.exe" -intro:off -CPUCount:1 So, what could be the problem? I'm fairly new, so I'm not really sure what info I need to provide. Thanks.

    Read the article

  • First time using select(), maybe a basic question?

    - by darkletter
    Hello people, i've been working for a few days with this server using select(). What it does, is that, i have two arrays of clients (one is "suppliers", and the other is "consumers"), and the mission of the server is to check whether the suppliers have something to send to the consumers, and in case affirmative, send it. The second part of the server is that, when the consumers have received the suppliers' info, they send a confirmation message to the same suppliers that sent the info. When a client connects, it gets recognized as "undefined", until it sends a message with the word "supplier" or "consumer" (in Spanish, as i'm from there), when the server puts it in the correct clients array. Well, what the server does is not very important here. What's important is that, i'm doing both parts with two different "for" loops, and that's where i'm getting the problems. When the first user connects to the server (be it a supplier or a consumer), the server gets stuck in the first or second loop, instead of just continuing its execution. As it's the first time i'm using select(), i may be missing something. Could you guys give me any sort of help? Thanks a lot in advance. for(;;) { rset=allset; nready=select(maxfd+1,&rset,NULL,NULL,NULL); if (FD_ISSET(sockfd, &rset)){ clilen=sizeof(cliente); if((connfd=accept(sockfd,(struct sockaddr *)&cliente,&clilen))<0) printf("Error"); IP=inet_ntoa(cliente.sin_addr); for(i=0;i<COLA;i++){if(indef[i]<0){indef[i]=connfd;IPind[i]=IP;break;}} FD_SET(connfd,&allset); if(connfd > maxfd) maxfd=connfd; if(i>maxii) maxii=i; if(--nready<=0) continue; }// Fin ISSET(sockfd) for(i=0;i<=maxii;i++){ if((sockfd1=indef[i])<0){ continue;} //! if(FD_ISSET(sockfd1,&rset)){ if((n=read(sockfd1,comp,MAXLINE))==0){close(sockfd1);FD_CLR(sockfd1,&allset);indef[i]=-1;printf("Cliente indefinido desconectado \n");} else{ comp[n]='\0'; if(strcmp(comp,"suministrador")==0){ for(j=0;j<=limite;j++){if(sumi[j]<0){IPsum[j]=IPind[i];sumi[j]=indef[i]; indef[i]=-1;if(j>maxis) {maxis=j;}break; } } } else if(strcmp(comp,"consumidor")==0){ for(o=0;j<=limite;j++){if(consum[o]<0){IPcons[o]=IPind[i];consum[o]=indef[i]; indef[o]=-1;if(o>maxic) {maxic=o;}break; } } } if(--nready <=0)break; } } }//fin bucle for maxii for(i=0;i<=maxis;i++){ if((sockfd2=sumi[i])<0){continue;} if(FD_ISSET(sockfd2,&rset)){ if((n=read(sockfd2,buffer2,MAXLINE))==0){close(sockfd2);FD_CLR(sockfd2,&allset);sumi[i]=-1;printf("Suministrador desconectado \n");} else{ buffer2[n]='\0'; for(j=0;j<=maxic;j++){ if((sockfd3=consum[j])<0){ continue;} else {strcpy(final,IPsum[i]);strcat(final,":");strcat(final,buffer2);write(sockfd3,final,sizeof(final));respuesta[i]=1;} } break; // ? } } }//fin for maxis for(i=miniic;i<=maxic;i++){ if((sockfd4=consum[i])<0){continue;} if(FD_ISSET(sockfd4,&rset)){ if((n=read(sockfd4,buffer3,MAXLINE))==0){close(sockfd4);FD_CLR(sockfd4,&allset);consum[i]=-1;printf("Consumidor desconectado \n");} else{ buffer3[n]='\0'; IP2=strtok(buffer3,":"); obj=strtok(NULL,":"); for(j=0;j<100;j++){ if((strcmp(IPsum[j],IP2)==0) && (respuesta[j]==1)) {write(sumi[j],obj,sizeof(obj)); miniic=i+1; respuesta[j]=0; break; } } } } }

    Read the article

1