stackoverflow1453

Programming&&Games&&Life

Archive for March, 2013

Ridiculous Fishing

http://www.ridiculousfishing.com/

This game is utterly awesome!! Brilliant idea..

Zoom forever!

http://gigapan.com/ 

Site with high res panoramic photos…

http://www.charmedlabs.com/index.php?option=com_content&task=view&id=111

Gigapan Imager…

http://www.charmedlabs.com/index.php?option=content&task=view&id=25

This monster is for Nintendo DS Programming…

Future of Gaming

http://www.altdevblogaday.com/2013/01/09/what-happens-next-2013/

Nice read about Gaming of Future… AAA Dead?

Lua

http://www.altdevblogaday.com/2013/02/19/why-lua/

I think of studying this language. Everybody recommends it.

Snayke

http://www.indiegamemag.com/snayke-review/

I encountered this game and it is rock solid. It seems developer put lots of work into this. I think  this game is underappreciated. Old title but really good implemented.

 

Spelunky

This game looks so nice and made in GameMaker.

You can download source codes on

http://spelunkyworld.com/original.html

and GameMaker here:

http://www.yoyogames.com/gamemaker/studio

Nice that they supplied the source codes…

Craps Game ver 2 (Added win counter, lose counter, dice roll counters)

/*
	Name:
	Question Copyright: C How to Program-Deitel
	Author: StackOverflow1453
	Date: 20.03.2013 16:42:05
	Description: 
	A player rolls two dice. Each die has six faces. 
	These faces contain 1, 2, 3, 4, 5, and 6 spots. 
	After the dice have come to rest, the sum of the spots on the two upward 
	faces is calculated. If the sum is 7 or 11 on the first throw, the player wins. 
	If the sum is 2, 3,or 12 on the first throw (called “craps”), the player loses 
	(i.e., the “house” wins). If thesum is 4, 5, 6, 8, 9, or 10 on the first throw, 
	then that sum becomes the player’s“point.” To win, you must continue rolling 
	the dice until you “make your point.” Theplayer loses by rolling a 7 before 
	making the point. 
		
*/

#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <conio.h>

int rollDice(void);

int main(void){
	
	int roll;
	int playersPoint=0;
	int targetPoint=0;
	int count;		
	int winCount=0;		//How many times did you win?
	int loseCount=0;		//How many times did you lose?
	int i;
	int howManyTimes=0;	//How many times do you want the game run?
	int rollCount=0;		//This counts the number of dice rolled whole
	
	srand(time(0));	//You have to call srand once and under main!!! Not in rollDice() function!!!		
	
	
	enum Gamestatus {WON,LOST,CONTINUE};
	enum Gamestatus status;
	
	printf("Enter how many times to play the game:");
	scanf("%d",&howManyTimes);
	

	
	for(i=1;i<=howManyTimes;i++){
	
	
		printf("Game starting!!\n");
		printf("Are you ready!!!!!!!\n\n");
		rollCount++;
		roll=rollDice();
		printf("You rolled %d.\n", roll);
		count=1;
		
		switch(roll){
			
			case 7:
			case 11:
				status=WON;
				printf("You WON in %d assumptions!\n",count);
				winCount++;
			break;
			
			case 2:
			case 3:
			case 12:	
				status=LOST;	
				printf("You LOST in %d assumptions!\n",count);
				loseCount++;
			break;
			
			default:
					status=CONTINUE;
					targetPoint=roll;
					printf("Your target point is: %d \n",roll);
					
					while(status==CONTINUE){
						count++;
						printf("You are rolling again: \n");
						rollCount++;
						printf("You rolled %d\n",roll=rollDice());
					
						if (targetPoint==roll){
							
							printf("You WON in %d assumptions!\n",count);
							winCount++;
							status=WON;
							
							
						}
						else if(7==roll){
							
							printf("You LOST in %d assumptions!\n",count);
							loseCount++;
							status=LOST;
						}
						else
							status=CONTINUE;
								
					} //end while
				
		}//end switch
	
	}//end for
		
	printf("Total winners: %d\nTotal losers: %d\n",winCount,loseCount);
	printf("You rolled the dice %d times.",rollCount);
	getch();
		
	return 0;
}//end main

int rollDice(void){
		
	return (1+rand()%6)+(1+rand()%6);
	
}