Tuesday 9 August 2011

A fortune telling with dice program written in C for LInux and Windows

#include<time.h>
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int i;
srand((unsigned)time(NULL));
i=rand()%6;
printf("\nThis is an oracle using a green, a white and a red dice.\n");
printf("\nLove situation.");
if(i==0)
{
printf("\nGreen six.");
printf("\nFruit tree.");
printf("\nPossessions, property, presentation.");
}
else
if(i==1)
{
printf("\nGreen five.");
printf("\nGoblet.");
printf("\nDrink, dining dibauchery.");
}
else
if(i==2)
{
printf("\nGreen four.");
printf("\nKey");
printf("\nOpportunity, doors opening or closing.");
}
else if(i==3)
{
printf("\nGreen three.");
printf("\nLadder.");
printf("\nAmbition, enthusiasm, new projects.");
}
else if(i==4)
{
printf("\nGreen two.");
printf("\nLightning.");
printf("\nThoughtlessness, wrong end of the stick.");
}
else
{
printf("\nGreen one.");
printf("\nSnail.");
printf("\nHealth, think on gaurd.");
}
printf("\n");
i=rand()%6;
printf("\nFinancial situation.");
if(i==0)
{
printf("\nWhite six.");
printf("\nCrossroads.");
printf("\nHidden surprises, strangers, outsiders.");
}
else if(i==1)
{
printf("\nWhite five.");
printf("\nCat.");
printf("\nHome marriage, family circle.");
}
else if(i==2)
{
printf("\nWhite four.");
printf("\nKnife.");
printf("\nTreachery, deceit, intrigues.");
}
else if(i==3)
{
printf("\nWhite three.");
printf("\nHeart.");
printf("\nLove, affection, friendship, fondness, passion, desire.");
}
else if(i==4)
{
printf("\nWhite two.");
printf("\nStork.");
printf("\nNew beginnings, fertility, ideas, inventiveness.");
}
else
{
printf("\nWhite one.");
printf("\nSun.");
printf("\nAmbition, drive, success.");
}
printf("\n");
i=rand()%6;
printf("\nGeneral situation.");
if(i==0)
{
printf("\nRed six.");
printf("\nBat.");
printf("\nA passing shadow which can hide good and evil.");
printf("\nWarning, omen, prediction, prophecy\n.");
}
else if(i==1)
{
printf("\nRed five.");
printf("\nBeetle.");
printf("\nDetermination, purposefulness, specific ambition, targets.\n");
}
else if(i==2)
{
printf("\nRed four.");
printf("\nHorseshoe.");
printf("\nGood fortune, success, laughter.\n");
}
else if(i==3)
{
printf("\nRed three.");
printf("\nBoat.");
printf("\nOutward journeys, travel, expeditions.\n");
}
else if(i==4)
{
printf("\nRed two.");
printf("\nSkull.");
printf("\nChange by transformation, sudden unexpected change.\n");
}
else
{
printf("\nRed one.");
printf("\nWeb.");
printf("\nConfusion, illusion, traps, pitfalls.\n");
}
return 0;
}

No comments:

Post a Comment