2012年9月26日水曜日

Win7を買ってきた

秋葉原に行ってきた。

買ってきたもの↓
・【無線LANアダプタ】Intel Centrino Advance-N 6205 for Desktop
・【HDD】WD10EZEX
・【OS】Windows 7 Professional DSP版
・【BDドライブ】BDR-207BK
・バランスケーブルの材料

Win7はBDドライブをバンドルした。
Win8の優待プログラムはどうしようかな~。

2012年9月13日木曜日

正多角形の対角線2



DXライブラリを使って、正多角形とその対角線を描写してみた。
前回と画像の見た目は変わらないが、今度は動く。

#include <math.h>
#include "DxLib.h"

#define PI 3.1415926

int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){
    SetMainWindowText("Diagonal");
    SetOutApplicationLogValidFlag(FALSE);
    ChangeWindowMode(TRUE);
    DxLib_Init();

    SetDrawScreen(DX_SCREEN_BACK);

    int x1, y1, x2, y2, SIZE=3, t=90;
    int Color = GetColor(255,0,255);
    double step;
    step = PI*2/SIZE;

    while(ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0){
        for(double i=0; i<2*PI; i+=step){
            x1 = (int)(200*cos(i));
            y1 = (int)(200*sin(i));
            for(double j=i+step; j< 2*PI; j+=step){
                x2 = (int)(200*cos(j));
                y2 = (int)(200*sin(j));
                DrawLine(320-y1,240-x1, 320-y2, 240-x2,Color);
            }
        }
        DrawFormatString(600, 440, Color, "%d", SIZE);

        t++;
        SIZE = (int)(t/30);
        step = PI*2/SIZE;
    }
    DxLib_End();
    return 0;
}

2012年9月4日火曜日

バイトの後って手がしびれる

Rewrite HFのおまけのリライトクエストを始めるか。
今月中に終わるかな…。