Click here to Skip to main content
15,908,264 members

Comments by Ketan D Kulkarni (Top 5 by date)

Ketan D Kulkarni 8-Sep-10 2:45am View    
Reason for my vote of 1
ertg
Ketan D Kulkarni 7-Sep-10 5:16am View    
//This is whole code which was producing above and a lots of errors ...file is //saved as .C

#include<stdio.h>

#include<conio.h>

#include<stdlib.h>

#include<ctype.h>

int ch;
char Y_N;
void EASY()
{
int colr, arr, i,j,r, b[6];
char col[]={'R','Y','BG','B','P','G'};
clrscr();
textcolor(25);
gotoxy(3,5);
cprintf("Guess the hidden codes
");
gotoxy(3,6);
cprintf("You only have fourteen tries.
");
showcolors();
for(i=0;i<6;i++)
{
int r=rand()%sizeof(col);
printf("%c ",col[r]);
}
printf("
");
for(i=1;i<=14;i++)
{printf("
Guess No. [%d]: ",i);
for(j=0;j<6;j++)
{scanf("%d",&b[j]);
{if(col[0]==b[0])
arr++;
else
if(col[1]==b[1]) /*What should i put in the position of col[1] and*/
col++; /*b[1] to compare the random code that was generated*/
else /*by the program and the characters that that was*/
if(a[0]==b[2]) /*inputted by the player of the game?*/
col++;
else
if(a[0]==b[3])
col++;
else
if(a[0]==b[4])
col++;
else
if(a[0]==b[5])
col++;}
{if(a[1]==b[1])
arr++;
else
if(a[1]==b[0])
col++;
else
if(a[1]==b[2])
col++;
else
if(a[1]==b[3])
col++;
else
if(a[1]==b[4])
col++;
else
if(a[1]==b[5])
col++;}
{if(a[2]==b[2])
arr++;
else
if(a[2]==b[0])
col++;
else
if(a[2]==b[1])
col++;
else
if(a[2]==b[3])
col++;
else
if(a[2]==b[4])
col++;
else
if(a[2]==b[5])
col++;}
{if(a[3]==b[3])
arr++;
else
if(a[3]==b[0])
col++;
else
if(a[3]==b[1])
col++;
else
if(a[3]==b[2])
col++;
else
if(a[3]==b[4])
col++;
else
if(a[3]==b[5])
col++;}
{if(a[4]==b[4])
arr++;
else
if(a[4]==b[0])
col++;
else
if(a[4]==b[1])
col++;
else
if(a[4]==b[2])
col++;
else
if(a[4]==b[3])
col++;
else
if(a[4]==b[5])
col++;}
{if(a[5]==b[5])
arr++;
else
if(a[5]==b[0])
col++;
else
if(a[5]==b[1])
col++;
else
if(a[5]==b[2])
col++;
else
if(a[5]==b[3])
col++;
else
if(a[5]==b[4])
col++;}
gotoxy(60,11);
printf("Arrangements: %d Colors: %d",arr,col);
{if(arr==6)
i=15;
printf("You have decoded the code. Congratulations!");}
}}

}
showcolors()
{
gotoxy(3,8);
printf("Colors are: ");
gotoxy(3,9);
textcolor(RED);
cprintf("[R]Red");
gotoxy(11,9);
textcolor(3);
cprintf("[BG]BlueGreen");
gotoxy(26,9);
textcolor(YELLOW);
cprintf("[Y]Yellow");
gotoxy(37,9);
textcolor(GREEN);
cprintf("[G]Green");
gotoxy(47,9);
textcolor(9);
cprintf("[B]Blue");
gotoxy(56,9);
textcolor(5);
cprintf("[P]Purple");
printf("
");
}
main()
{
clrscr();
printf("MASTERMIND GAME

");
printf("Choose Difficulty
[1] EASY
[2] NORMAL
[3] HARD

");
printf("Your Choice: ");
scanf("%d",&ch);
if(ch==1)
EASY();
else
if(ch==2)
printf("*");
else
if(ch==3)
printf("*");
else
printf("
WRONG KEY!");
getch();
}
Ketan D Kulkarni 26-Aug-10 2:34am View    
No not that ..But whenever U write code in studio automatically language specific code is generated by code generator classes in System.dll but in which language those classes are written .( All in all in which language all base class libraries are written ??)
Ketan D Kulkarni 26-Aug-10 2:17am View    
Hi sir ,
How is that going to help to my question?
Ketan D Kulkarni 26-Aug-10 2:12am View    
Yes sir you are right but I am interested in this because that is what .NET reflector is doing ...