예제 #1
0
int main()
    {
    _txWindowStyle &= ~ WS_CAPTION;

    txCreateWindow (XWindow, YWindow);
    Osnov ();
    }
예제 #2
0
int main()
    {
    txCreateWindow (sizeX, sizeY);

    palochka Main[ColVo];

    while (!GetAsyncKeyState (VK_ESCAPE))
        {
        txBegin ();
        txSetFillColor (TX_BLACK);
        txSetColor     (TX_BLACK);
        txClear ();

        for (int i = 0; i < ColVo; i++)
            {
            all_fizics(&(Main[i]));

            print_palochka (Main[i]);
            }

        txEnd   ();
        }

    return 0;
    }
예제 #3
0
파일: mult code.cpp 프로젝트: Fokz210/Mult
int main()
    {
    txCreateWindow (1200, 700);

    txSelectFont ("Comic Sans MS", -20, -30);
    txPlaySound ("msc.wav");
    Titry();
    txClear();
    txTextOut (500, 350, "Жил был один козёл...");
    txSleep (1000);
    txClear ();
    txTextOut (500, 350, "И его все любили");
    GoatLove ();
    txPlaySound ("msc.wav");
    txSleep (2000);
    txClear ();
    txTextOut (500, 350, "Но потом появился");
    txSleep (1000);
    txClear ();
    txPlaySound ("Tam.wav");
    txTextOut (575, 350, "ОН");
    FxDrawTv (TX_LIGHTGRAY, TX_BLACK, 500, 500);
    txSleep(5000);
    txPlaySound ("msc.wav");
    TitryEnd();



    return 0;

    }
예제 #4
0
int main()
{
	txCreateWindow(800, 640);
	txSetColor(TX_RED);
	txArc(400, 0, 800, 320, 90, 180);

	return 0;
}
예제 #5
0
int main()
    {
    _txWindowStyle &= ~ WS_CAPTION;
    txCreateWindow (XWindow, YWindow);

    Mandelbrod (0, 0, 100);

    return 0;
    }
예제 #6
0
int main()
    {
    _txWindowStyle &= ~ WS_CAPTION;

    txCreateWindow (XWindow, YWindow);

    Kot ();

    return 0;
    }
예제 #7
0
파일: Proga.cpp 프로젝트: Fokz210/Proga
int main()
    {

    txCreateWindow (1200, 700);
    txSetFillColor (TX_WHITE);
    txClear();

    TextOut();

    }
예제 #8
0
파일: 2massive.cpp 프로젝트: Timshbnv/pelmV
int main()
    {

	

    txCreateWindow (MASSSIZE * SIZEB, MASSSIZE * SIZEB);
    char map [MASSLAYER][MASSSIZE][MASSSIZE] = {};
	int lvl = 1;
	int winlose = 0;
	int lakomka = 0;

	while (true)
	{


		ReadKarta(map, lvl);

		int layer = 0;
		int pos = 1;
		int x = SIZEB * 4 - SIZEB / 2;
		int y = SIZEB * 4 - SIZEB / 2;
		txBegin();
		while (true)
		{

			int whrgo = MovingOn(map, layer, &pos, x, y, &lakomka);
			printf ("%d",lakomka);

			switch (pos)
			{
			case 1: x = SIZEB * MASSSIZE / 2;           y = SIZEB * MASSSIZE - SIZEB * 1.5; break;
			case 2: x = 1.5 * SIZEB;                    y = SIZEB * MASSSIZE / 2; break;
			case 3: x = SIZEB * MASSSIZE / 2;           y = SIZEB + SIZEB * 0.5; break;
			case 4: x = SIZEB * MASSSIZE - SIZEB * 1.5; y = SIZEB * MASSSIZE / 2; break;

			}

			switch (whrgo)
			{
			case 2: layer = 0; break;
			case 3: layer = 1; break;
			case 4: layer = 2; break;
			default: layer = 0;
			}

			if (whrgo == 0) { winlose = 0;  break; }
			else if (whrgo == 1) { winlose = 1;  break; }

		}
		txEnd();
		if (winlose == 0) { txMessageBox("LOSSE", "LOSSE2"); lakomka = 0; }
		if (winlose == 1) {txMessageBox("WINNY", "WINNY2"); lvl++;}
	}

}
예제 #9
0
int main ()
{
    int n = 0;

    SortingAlgorithm sortAlgArray[SORT_ALG_ARRAY_SIZE] =
    {
        SortingAlgorithm (         bubbleSort, { 12, 205,  90}, n++, Mode (0, 2)),
        SortingAlgorithm (      selectionSort, {205,  12,  90}, n++, Mode (0, 2)),
        SortingAlgorithm (      insertionSort, { 12,  90, 205}, n++, Mode (0, 2)),
        SortingAlgorithm (binaryInsertionSort, {112,  90, 155}, n++, Mode (0, 2))
    };

    Button buttonArray[BUTTON_ARRAY_SIZE] =
    {
        Button (Point (  0,   0),   0,  0, "BubbleSort"         ),
        Button (Point (  0,   0),   0,  0, "SelectionSort"      ),
        Button (Point (  0,   0),   0,  0, "InsertionSort"      ),
        Button (Point (  0,   0),   0,  0, "BinaryInsertionSort"),
        Button (Point (130, 405), 140, 30, "Now watching:"      ),
        Button (Point (  4, 367),  56, 26, "Play/Stop"          )
    };

    distributeButtons (buttonArray, BUTTON_ARRAY_SIZE, 4, Point (654, 140), Point (954, 440));

    Mode mode     = Mode(COMPS, 3),
    updateGraphic = Mode(    1, 2);

    _txWindowStyle &= ~WS_CAPTION;
    txCreateWindow (WIDTH, HEIGHT);
    txTextCursor (false);

    HDC background = txLoadImage ("sortTube.bmp");
    assert (background);

    while (!GetAsyncKeyState (VK_ESCAPE))
    {
        txBegin ();
        txBitBlt (txDC (), 0, 0, 960, 480, background);
        txClearConsole ();

        calculations (sortAlgArray, SORT_ALG_ARRAY_SIZE, buttonArray, BUTTON_ARRAY_SIZE, &mode, &updateGraphic);

        //rendering    (sortAlgArray, SORT_ALG_ARRAY_SIZE, buttonArray, BUTTON_ARRAY_SIZE,  mode);

        txEnd ();
        txSleep (1000/30);
    }

    txDeleteDC (background);

    return 0;
}
예제 #10
0
파일: Example03.cpp 프로젝트: ded32/txlib
int main()
    {
    txCreateWindow (800, 600);

    DrawFrame();
    DrawEarth();
    DrawHello();
    DrawMan();
    DrawFlag();

    txTextCursor (false);
    return 0;
    }
예제 #11
0
int main()
    {
    txCreateWindow (800, 600);

    const int Size = 10;
    int data [Size] = {1, 3, 6, 14, 23, 43, 46, 13, 32, 10};
    int sorted = 6;

    $r printf ("привет ¤ массив : 1, 3, 6, 14, 23, 43, 46, 13, 32, 10 \n");
    DoubleInsertion (data, Size, sorted);
    //Print (data, Size, 0);

    $c printf (" ¤ сортировка двоичного поиска и вот твой массив:  \n ");
    for (int i = 0; i < Size; i++)
        {
        $g printf ("  %d  ", data [i]);
        }

    return 0;
    }
예제 #12
0
int main ()
{
    _txWindowStyle &= ~ WS_CAPTION;
    txCreateWindow (XWindow, YWindow);
    C_Ball ball [4500] = {};
    Mass_Ball (ball, 4500);
    for (int i = 0;; i++)
    {
        txBegin ();
        if (!GetAsyncKeyState (VK_SPACE))
        {
            txSetFillColor (TX_BLACK);
            txSetColor (TX_BLACK);
            txClear ();
        }
        Dvig_and_draw (ball, 4500);
        txSleep (0);
        txEnd ();
    }
}
예제 #13
0
int main ()
    {
    txCreateWindow (1500, 800);
    MoveShar ();
    }
예제 #14
0
int main (int argc, char **argv)
{
if (argc != 2)
    {
    txMessageBox("Haven't file for play");
    return 1;
    }
txTextCursor (false);
txCreateWindow (1080, 720);
txSetFillColor (TX_WHITE);

const char* logf = "DATA/log.txt";
FILE* log = fopen (logf, "a");

fprintf (log, "\n\n=========hulc started=========\n");

FILE* read = fopen (argv[1], "r");

COLORREF cvet = TX_WHITE;

Stack stk = {};
double pushch = 0;

double deystvie = 0;

int cmd = 0;

int element = 0;

double proga[MAXSYMBOLINCOMMANDFILE];

fprintf (log, "\n\n\n=========hulc read and printf to array of programm do =========\n");
    for ( ; element <= MAXSYMBOLINCOMMANDFILE; element++)
        {
        txSetColor (cvet);
        txSetFillColor (cvet);
        fscanf (read, "%lg", &deystvie);
        proga[element] = deystvie;
        fprintf (log, "hulc printf to array of programm %lg\n", deystvie);
/*        switch (deystvie)
            {
            case cmdLINE:       proga[element] = cmdLINE;                                                                                   element++;              break;
            case cmdBUCKET:     proga[element] = cmdBUCKET;                                                                                 element++;              break;
            case cmdJUMP:       proga[element] = cmdJUMP;                                                                                   element++;              break;
            case cmdOUT:        proga[element] = cmdOUT;                                                                                    element++;              break;
            case cmdCOLOR:      proga[element] = cmdCOLOR;                                                                                  element++;              break;
            case cmdCIRCLE:     proga[element] = cmdCIRCLE;                                                                                 element++;              break;
            case cmdRECTANGLE:  proga[element] = cmdRECTANGLE;                                                                              element++;              break;
            case cmdTRIANGLE:   proga[element] = cmdTRIANGLE;                                                                               element++;              break;
            case cmdADD:        proga[element] = cmdADD;                                                                                    element++;              break;
            case cmdPUSH:       proga[element] = cmdPUSH; element++; fscanf (read, "%lg", &pushch); proga[element] = pushch;                element++;              break;
            case cmdPUSHR:      proga[element] = cmdPUSHR; element++; fscanf (read, "%lg", &stk.ireg); proga[element] = stk.ireg;           element++;              break;
            case cmdPOPR:       proga[element] = cmdPOPR; element++; fscanf (read, "%lg", &stk.ireg); proga[element] = stk.ireg;            element++;              break;
            case cmdSUB:        proga[element] = cmdSUB;                                                                                    element++;              break;
            case cmdMUL:        proga[element] = cmdMUL;                                                                                    element++;              break;
            case cmdDIV:        proga[element] = cmdDIV;                                                                                    element++;              break;
            case cmdEXIT:       proga[element] = cmdEXIT;                                                                                                           break;
            }*/
        }
        element++;
        proga[element] = cmdEXIT;

    fprintf (log, "\n\n======hulc end read program and he start do this is program======\n\n\n");

    deystvie = 0;
    pushch = 0;
    element = 0;
    stk.ireg = 0;
    pushch = 0;
    stk.ireg = 0;
    for (int i = 0; i <= MAXSYMBOLINCOMMANDFILE; i++)
        {
        txSetColor (cvet);
        txSetFillColor (cvet);
        cmd = proga[element];
        switch (cmd)
            {
            case cmdCOPY: copynum (&stk);                                                element++; break;
            case cmdLINE: line (&stk);                                                   element++; break;
            case cmdPUSH: element++; pushch = proga[element]; stk.push (pushch);         element++; break;
            case cmdBUCKET: clearw (&stk);                                               element++; break;
            case cmdOUT: out (&stk);                                                     element++; break;
            case cmdJUMP: jump (&stk, &element);                                                    break;
            case cmdCOLOR: color (&stk, &cvet);                                          element++; break;
            case cmdCIRCLE: circle (&stk);                                               element++; break;
            case cmdRECTANGLE: rectangle (&stk);                                         element++; break;
            case cmdTRIANGLE: triangle (&stk);                                           element++; break;
            case cmdADD: stk.Vplus ();                                                   element++; break;
            case cmdPUSHR: element++; stk.ireg = proga[element]; stk.pushr (stk.ireg);   element++; break;
            case cmdPOPR: element++; stk.ireg = proga[element]; stk.popr (stk.ireg);     element++; break;
            case cmdSUB: stk.Vminus ();                                                  element++; break;
            case cmdMUL: stk.Vumnozhity ();                                              element++; break;
            case cmdDIV: stk.Vdeleniye ();                                               element++; break;
            case cmdIN: in(&stk);                                                        element++; break;
            case cmdEXIT: fprintf (log, "\n\n ========hulc end do programm, number 0========"); return 0;
            default: txMessageBox ("ERROR Code, program end.", "hulc"); fprintf (log, "ERROR Code, number 2\n"); return 1;
            }
        fprintf (log, "hulc do %d\n", cmd);
        }
    fprintf (log, "\n\n ========hulc end do programm, number 3 (but you haven't gave me cmdEXIT(you luser:) ))========");
    return 3;
    }
예제 #15
0
int main()
    {
     _txWindowStyle &= ~ WS_CAPTION;

    txCreateWindow (XWindow, YWindow);

    int sz = 15;

    CBall  Ball [15] = {};

    Mass1 (Ball, sz);
    //double x = 0, y = 0, z = 0;
    //double vx = 0.06, vy = 0.04, vz = 0.02, dt = 1;
    while (!GetAsyncKeyState (VK_ESCAPE))
        {
        txSetFillColor (TX_WHITE);
        txBegin();
        txClear ();

        txSetColor (TX_BLUE, 5);
        Line3D ( 1,  1,  1, -1,  1,  1);
        Line3D (-1,  1, -1,  1,  1, -1);
        Line3D (-1,  1, -1, -1,  1,  1);
        Line3D ( 1,  1,  1,  1,  1, -1);

        txSetColor (TX_BROWN, 5);
        Line3D (-1, -1,  1, -1, -1, -1);
        Line3D ( 1, -1,  1, -1, -1,  1);
        Line3D ( 1, -1, -1,  1, -1,  1);
        Line3D ( 1, -1, -1, -1, -1, -1);

        txSetColor (TX_GREEN, 5);
        Line3D (-1,  1,  1, -1, -1,  1);
        Line3D (-1,  1, -1, -1, -1, -1);
        Line3D ( 1,  1, -1,  1, -1, -1);
        Line3D ( 1,  1,  1,  1, -1,  1);

        printf ("%lf, %lf,\n",ZoomZ, zGlob);

        /*txSetColor (TX_ORANGE, 5);
        Line3D (0, 3, 0,  1, 1, -1);
        Line3D (0, 3, 0, -1, 1,  1);
        Line3D (0, 3, 0, -1, 1, -1);
        Line3D (0, 3, 0,  1, 1,  1);*/
        /*
        for (int K = 0; K < sz; K++)
            {
            Dvig (&Ball [K], 1, 1, 1);
            txSetColor (RGB(random (50, 250), random (50, 250), random (50, 250))
            , 5);
            txSetFillColor (RGB(random (50, 250), random (50, 250), random (50, 250)));
            Circle3D (Ball[K].x, Ball[K].y, Ball[K].z, Ball[K].rad);
            }
        */
        /*Line3D (0, 0, 0, 10, 0, 0);
        Line3D (0, 0, 0, 0, 10, 0);
        Line3D (0, 0, 0, 0, 0, 10);*/

        Skale3D ();
        Translete3D ();
        Rotate ();
        txEnd ();
        }
    return 0;
    }
예제 #16
0
int main()
    {
    txCreateWindow(SX * 2, SY * 2);
    txTextCursor(false);
    SetWindowText(txWindow(), "Illusions");


    Illusions illus[ILLUSIONS] = {};

    HDC skins[ILLUSIONS] = {txLoadImage("WTF.bmp"),
                            txLoadImage("Cat.bmp"),
                            txLoadImage("Packman.bmp"),
                            txLoadImage("Spiral.bmp"),
                            txLoadImage("Sphere.bmp"),
                            txLoadImage("Figure.bmp"),
                            txLoadImage("DINOSOWER.bmp"),
                            txLoadImage("Packman2.bmp"),
                            txLoadImage("Cab.bmp"),
                            txLoadImage("Cab2.bmp"),
                            txLoadImage("Head.bmp"),
                            txLoadImage("6terna.bmp"),
                            txLoadImage("6terna4.bmp"),
                            txLoadImage("bike.bmp"),
                            txLoadImage("Ўарик.bmp"),
                            txLoadImage("fish.bmp"),
                            txLoadImage("kriper.bmp"),
                            txLoadImage("WTF2.bmp"),
                            txLoadImage("kub.bmp"),
                            txLoadImage("water.bmp"),
                            txLoadImage("serdce.bmp")};

    HDC transparent = txLoadImage("Transparent5.bmp");

    double x = -450, y = 25;

    for(int i = 0; i < ILLUSIONS; i++) illus[i].SetSkin(skins[i]);
    illus[0].show = true;

    while(!Key(27))
        {
        txBegin();
        txSetFillColor(TX_BLACK);
        txClear();

        for(int i = 0; i < ILLUSIONS; i++)
            {
            if(illus[i].show)
                {
                txBitBlt(txDC(), illus[i].x, illus[i].y, X_DEST * 2, Y_DEST * 2, illus[i].skin, 0, 0);
                if(Key('1'))
                    {
                    if(i > 0) illus[i].show = false, illus[i         - 1].show = true;
                    else      illus[i].show = false, illus[ILLUSIONS - 1].show = true;
                    }
                if(Key('2'))
                    {
                    if(i < ILLUSIONS - 1) illus[i].show = false, illus[i + 1].show = true;
                    else                  illus[i].show = false, illus[    0].show = true;
                    }

                while(Key('1') || Key('2')) txSleep (1);
                }
            }

        if(Key(VK_LEFT )) x -= 0.25;
        if(Key(VK_RIGHT)) x += 0.25;
        if(Key(VK_UP   )) y--;
        if(Key(VK_DOWN )) y++;

        txTransparentBlt(txDC(), x, y, X_DEST * 4, Y_DEST * 2, transparent, 0, 0, TX_WHITE);

        txEnd();
        }

    txDeleteDC(transparent);

    return 0;
    }