13-12-2004, 22:10
|
|
|
חבר מתאריך: 02.11.04
הודעות: 186
|
|
פשוט מאוד :)
נניח והפונקציה שלך מוגדרת ככה:
int GetCurrentFreq();
במקרה שלחוץ מקש היא מחזירה את התדר שלא ובמידה שלא, 0.
קוד התוכנית שלך יהיה פשוט:
int keys[4] = {0}; /* Define an array and initialize it */
while(1) /* Loop Forever */
{
for(int i = 0; i < 4; i++)
{
while(key[i] = GetCurrentFreq() == 0);
}
if(key[0] == 10000 && key[1] == 20000 && key[3] == 3000 && key[4] == 4000)
{
/* Currect Password was entered (1234) */
break;
}
else
{
/* Print error message and write to log file */
}
}
/* The Rest of the Code */
מקווה שעזרתי
בהצלחה !!!
_____________________________________
בברכה, אלכסנדר.
"The object of war is not to die for your country but to make the other bastard die for his" - General George S Patton
נערך לאחרונה ע"י ProgrammerX בתאריך 13-12-2004 בשעה 22:16.
|