I have a small problem that would require some help from someone with C# programming skills. The problem is that for my course which I’m currently attending I need to program a Game called Sokoban. If that isn’t enough the program would have to include the Algorithm to explain how it works. Has anyone here ever done this as their course work? Can someone help me with this??? Would really appreciate it
Try to view Sokoban YASC project at the sourceforge * net but their open source code is marked as Delphi/Kylix or view Sokoban Tux on Java
The problem is that I need to write the program in C# and have little experience with that language. Trying to port from other languages will be virtually impossible to me.
If you know C++ or Java, there are a lot of similarities...especially with Java. Not identical, mind you...but similar. If that helps at all...maybe a Java guru can give you a hand.
I did some programming in vc#. Not sure about the game. I feel for you if you reaseach and try yourself it will be good for you as there will be somany things you will learn when you will try , try to do yourself , ask for specific problem , then you will get right kind of suggestions
The problem is that I don’t even know where to start. I don’t have a lot of time since I work and study at the same time so was looking for someone that might have some experience with this sort of thing…
I’ve been searching all over the net but haven’t found anything that could help me…. I really don’t know what to do now… Does anyone know of any good programming forums??? Maybe I’ll try that…
Are you looking for someone to write this for you, or someone to help? To me, it sounds like you've skipped over a few (or many) lectures, since you're asking where to start. You need to do a high-level design first, then if you're very unfamiliar with programming do a detaled design (e.g. an outline) of the code structure. Once you have the design, filling in the code isn't that difficult. But for an inexperienced programmer, you'll need at least a day to code the backend and another day to code the graphics (assuming VERY simple windows GUI images/buttons/etc will do). Depending on the teachers requirements, your time involved could be more. If you don't have that amount of time, you should just be upfront and ask someone to code it for you, but don't mention it's for a class. On rentacoder.com, some people will code things like this for under $100 (if you go with the cheapest bid, don't expect the best code in return though). Anita
What I’m actually looking for is for some help or guidance on where to start and where to find information. The game would be text based so there’s no need for graphics and such, but for me it’s still quite a task. Since there are so many Computer Science students on this forum I thought some could help me since this game is commonly used as training for beginners.
How much information has the teacher provided for you? I think the problem is that you are looking at this as a C# problem, and not a programming problem. This is how I would tackle the problem: 1) Define the high level requirements 2) Determine the algorithms required for controlling gameplay (paper and pencil it, no programming yet) 3) Define classes and memory structures for storing game state 4) Hash out any remaining details 5) Program it For a beginner, your best friend is a piece of paper or a whiteboard when first designing a program. That way you don't get too bogged down in the language (which is really immaterial). Anita
My suggestion is rather than doing to whole project , you try to build somthing that does small things. If the project seems to you duanting , you could take it later , not sure it will hurt your course. Try to do small things first Some programmer forums vbforums.com vbcity.com codeproject.com
Well this is what I got so far #include <stdio.h> void moverEsquerda(int areaJogo[19][19], int coluna, int linha); void moverDireita(int areaJogo[19][19], int coluna, int linha); void moverCima(int areaJogo[19][19], int coluna, int linha); void moverBaixo(int areaJogo[19][19], int coluna, int linha); void apresentarAreaJogo(int areaJogo[19][19]); int obterNumeroCaixas(int areaJogo[19][19]); int obterNumeroCaixas(int areaJogo[19][19]) { int numeroCaixas = 0; int i,j; for(i=0; i < 19; i=i++) { for(j=0; j<19; j++) { if(areaJogo[j][i] == 2)numeroCaixas++; } } return(numeroCaixas); } void apresentarAreaJogo(int areaJogo[19][19]) { int i,j; for(i=0; i < 19; i=i++) { for(j=0; j<19; j++) { printf("%d", areaJogo[j][i]); } printf("%\n"); } } void moverEsquerda(int areaJogo[19][19], int coluna, int linha) { if(areaJogo[coluna-1][linha] == 0) { areaJogo[coluna-1][linha] = 1; areaJogo[coluna][linha] = 0; } } void moverDireita(int areaJogo[19][19], int coluna, int linha) { if(areaJogo[coluna+1][linha] == 0) { areaJogo[coluna+1][linha] = 1; areaJogo[coluna][linha] = 0; } } void moverCima(int areaJogo[19][19], int coluna, int linha) { if(areaJogo[coluna][linha-1] == 0) { areaJogo[coluna][linha-1] = 1; areaJogo[coluna][linha] = 0; } } void moverBaixo(int areaJogo[19][19], int coluna, int linha) { if(areaJogo[coluna][linha+1] == 0) { areaJogo[coluna][linha+1] = 1; areaJogo[coluna][linha] = 0; } } int main(int argc, char *argv[]) { int areaJogo[19][19] = { {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,}, {9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9}, {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9}, }; int coluna = 1; int linha = 1; int caixas = obterNumeroCaixas(areaJogo); int opcao = -1; do { if(opcao == 0) { return; } else if(opcao == 1) { moverEsquerda(areaJogo, coluna, linha); coluna = coluna-1; } else if(opcao == 2) { moverDireita(areaJogo, coluna, linha); coluna = coluna+1; } else if(opcao == 3) { moverCima(areaJogo, coluna, linha); linha = linha-1; } else if(opcao == 4) { moverBaixo(areaJogo, coluna, linha); linha = linha+1; } apresentarAreaJogo(areaJogo); printf("1 - Mover Esquerda\n"); printf("2 - Mover Direita\n"); printf("3 - Mover Cima\n"); printf("4 - Mover Baixo\n"); printf("0 - Sair\n"); fflush(stdin); scanf("%d", &opcao); }while(caixas > 0); } Code (markup): Can someone help me with a few problems I'm having?