Skip to content

Instantly share code, notes, and snippets.

View aoisensi's full-sized avatar
🔪
pep me

aoisensi aoisensi

🔪
pep me
View GitHub Profile
@aoisensi
aoisensi / gist:3459883
Created August 25, 2012 03:22
cpp win form test
#include <Windows.h>
#include <tchar.h>
LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPInst, LPSTR lpCmd, int nCmd)
{
WNDCLASSEX wc;
wc.cbClsExtra = sizeof(WNDCLASSEX);
@aoisensi
aoisensi / gist:3460535
Created August 25, 2012 04:07
cpp win form test 2
#include <Windows.h>
#include <tchar.h>
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPInst, LPSTR lpCmd, int nCmd)
{
WNDCLASSEX wc;
wc.cbSize = sizeof(WNDCLASSEX);
@aoisensi
aoisensi / gist:3506453
Created August 29, 2012 03:15
三角形の内包判定 多分間違ってる 無駄に頑張ってみた
//http://www5d.biglobe.ne.jp/~tomoya03/shtml/algorithm/IntersectionEX.htm
bool IL::ILZBuffer::IsTriangleInPoint(const ILVECTOR2 &A, const ILVECTOR2 &B, const ILVECTOR2 &C, const ILVECTOR2 &P)
{
return IsCross(ILSEGMENT2(A,B),ILSEGMENT2(C,P)) && IsCross(ILSEGMENT2(B,C),ILSEGMENT2(A,P)) && IsCross(ILSEGMENT2(C,A),ILSEGMENT2(B,P));
}
bool IL::ILZBuffer::IsCross(const ILSEGMENT2 &A,const ILSEGMENT2 &B)
{
return !((IsCrossSub(A.a.x,A.b.x,B.a.x,B.b.x)) || (IsCrossSub(A.a.y,A.b.y,B.a.y,B.b.y))) && (((((A.a.x - A.b.x) * (B.a.y - A.a.y) + (A.a.y - A.b.y) * (A.a.x - B.a.x)) * ((A.a.x - A.b.x) * (B.b.y - A.a.y) + (A.a.y - A.b.y) * (A.a.x - B.b.x))) > 0.0F) && (((B.a.x - B.b.x) * (A.a.y - B.a.y) + (B.a.y - B.b.y) * (B.a.x - A.a.x)) * ((B.a.x - B.b.x) * (A.b.y - B.a.y) + (B.a.y - B.b.y) * (B.a.x - A.b.x)) > 0.0F));
@aoisensi
aoisensi / gist:3513320
Created August 29, 2012 14:24
OperatorSpeed
#include <iostream>
#include <time.h>
using namespace std;
const double pi = 3.14159265F;
const double s2 = 1.41421356F;
const int n = 1000000000;
int main()
{
double Sqrt(const double &o)
{
double s = o;
double t;
if(o == 0)
{
return 0;
}
do
{
@aoisensi
aoisensi / gist:3664701
Created September 7, 2012 09:43
Donut
const double uwaa = 100;
const double uwaaa = 50;
const int www = 5;
for(int i=-www;i<www;++i)
{
for(int j=-www;j<www;++j)
{
ILVECTOR a, b, c, d;
a = ILVECTOR(uwaa*IL::ILMath::Cos(i/www*M_PI) + uwaaa*IL::ILMath::Cos(i/www*M_PI)*IL::ILMath::Cos(j/www*M_PI), uwaaa*IL::ILMath::Sin(j/www), uwaa*IL::ILMath::Sin(i/www*M_PI) + uwaaa*IL::ILMath::Sin(i/www*M_PI)*IL::ILMath::Sin(j/www*M_PI));
b = ILVECTOR(uwaa*IL::ILMath::Cos((i+1)/www*M_PI) + uwaaa*IL::ILMath::Cos((i+1)/www*M_PI)*IL::ILMath::Cos(j/www*M_PI), uwaaa*IL::ILMath::Sin(j/www), uwaa*IL::ILMath::Sin((i+1)/www*M_PI) + uwaaa*IL::ILMath::Sin((i+1)/www*M_PI)*IL::ILMath::Sin(j/www*M_PI));
@aoisensi
aoisensi / gist:3684350
Created September 9, 2012 13:35
DOMINION
[1ターン: AI1]
銅貨,銅貨,銅貨,銅貨を使用しました。
民兵を購入しました。
[1ターン: aoisensi]
銅貨,銅貨を使用しました。
地下貯蔵庫を購入しました。
[2ターン: AI1]
銅貨,銅貨,銅貨を使用しました。
銀貨を購入しました。
(AI1がデッキを切り直しました。)
@aoisensi
aoisensi / gist:3684843
Created September 9, 2012 14:55
DOMINION aoisensi vs らぁ
[1ターン: らぁ]
銅貨,銅貨,銅貨,銅貨を使用しました。
銀貨を購入しました。
[1ターン: aoisensi]
銅貨,銅貨,銅貨,銅貨を使用しました。
鍛冶屋を購入しました。
[2ターン: らぁ]
銅貨,銅貨,銅貨を使用しました。
村を購入しました。
(らぁがデッキを切り直しました。)
@aoisensi
aoisensi / gist:3685148
Created September 9, 2012 15:43
DOMINION aoisensi vs bgnori
[1ターン: bgnori]
銅貨,銅貨,銅貨,銅貨を使用しました。
民兵を購入しました。
[1ターン: aoisensi]
銅貨,銅貨,銅貨,銅貨を使用しました。
鍛冶屋を購入しました。
[2ターン: bgnori]
銅貨,銅貨,銅貨を使用しました。
工房を購入しました。
(bgnoriがデッキを切り直しました。)
@aoisensi
aoisensi / gist:3685313
Created September 9, 2012 16:08
aoisensi vs bgnori
[1ターン: bgnori]
銅貨,銅貨,銅貨を使用しました。
銀貨を購入しました。
[1ターン: aoisensi]
銅貨,銅貨,銅貨,銅貨を使用しました。
祝宴を購入しました。
[2ターン: bgnori]
銅貨,銅貨,銅貨,銅貨を使用しました。
金貸しを購入しました。
(bgnoriがデッキを切り直しました。)