İnternette dolaşırken denk geldim. Çok hoş bir program. Sizlerle paylaşmak istedim. Umarum daha önce paylaşılmamıştır.
Kod:
[FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]
#include[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] [/COLOR][/FONT][FONT=Consolas][COLOR=#a31515][FONT=Consolas][COLOR=#a31515]<iostream>
[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]#include[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] [/COLOR][/FONT][FONT=Consolas][COLOR=#a31515][FONT=Consolas][COLOR=#a31515]<windows.h>
[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] Modulus([/COLOR][/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] iN, [/COLOR][/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] iMod){[/COLOR]
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] iQ = (iN/iMod);
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]return[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] iN - (iQ*iMod);
}
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]char[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] GetChar([/COLOR][/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] iGenerator, [/COLOR][/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]char[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] cBase, [/COLOR][/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] iRange){[/COLOR]
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]return[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] (cBase + Modulus(iGenerator, iRange));
}
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000] main(){[/COLOR]
[/FONT][FONT=Consolas][COLOR=#008000][FONT=Consolas][COLOR=#008000]//Color Code
[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas]HANDLE hConsole;
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, 2);
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]char[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] caRow[80];
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] j = 7;
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] k = 2;
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] l = 5;
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] m = 1;
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]while[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] ([/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]true[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas]){
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]int[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] i = 0;
[/FONT][FONT=Consolas][COLOR=#008000][FONT=Consolas][COLOR=#008000]// Output a random row of characters
[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]while[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] (i<80){
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]if[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] (caRow[i] != [/FONT][FONT=Consolas][COLOR=#a31515][FONT=Consolas][COLOR=#a31515]' '[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas]){
caRow[i] = GetChar(j+i*i, 33, 30);
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]if[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] (((i*i+k) % 71) == 0) {
SetConsoleTextAttribute(hConsole, 7);
}
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]else[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] {
SetConsoleTextAttribute(hConsole, 2);
}
}
std::cout << caRow[i];
++i;
SetConsoleTextAttribute(hConsole, 2);
}
j = (j+31);
k = (k+17);
l = (l+47);
m = (m+67);
caRow[Modulus(j, 80)] = [/FONT][FONT=Consolas][COLOR=#a31515][FONT=Consolas][COLOR=#a31515]'-'[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas];
caRow[Modulus(k, 80)] = [/FONT][FONT=Consolas][COLOR=#a31515][FONT=Consolas][COLOR=#a31515]' '[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas];
caRow[Modulus(l, 80)] = [/FONT][FONT=Consolas][COLOR=#a31515][FONT=Consolas][COLOR=#a31515]'-'[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas];
caRow[Modulus(m, 80)] = [/FONT][FONT=Consolas][COLOR=#a31515][FONT=Consolas][COLOR=#a31515]' '[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas];
[/FONT][FONT=Consolas][COLOR=#008000][FONT=Consolas][COLOR=#008000]// Delay
[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas]Sleep(10);
}
[/FONT][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]return[/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas] 0;
}
[/FONT]