16,021,041 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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 ...