- 29 名前:名前は開発中のものです。 mailto:sage [2013/11/11(月) 11:31:03.35 ID:utjYUJKi]
- この方法は誤差が多いな
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { ChangeWindowMode(TRUE); SetGraphMode(640, 400, 32); if (DxLib_Init() == -1) return -1; int n = 0; int naka = 0; while (!ProcessMessage()) { ClearDrawScreen(); DrawBox(0, 0, 399, 399, GetColor(255, 255, 255), TRUE); DrawCircle(00, 399, 399, GetColor(0, 0, 255), true); int x = GetRand(399); int y = GetRand(399); int Cr = GetPixel(x, y); n++; if (Cr == 255) naka++; double kekka = (double)naka / n * 4.0; DrawFormatString(400, 0, GetColor(255, 255, 0), L"%f\n", kekka); ScreenFlip(); } DxLib_End(); return 0; }
|

|