Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Forum Games

Press Ctrl+V or Cmd+V or whatever and post - Page 16

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: ultraVex
Date: 2009-01-25 19:10:34
http://i42.tinypic.com/2qjjal0.png


(Don't even ask.)

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: ?????(000)
Date: 2009-01-26 10:53:26
http://www.youtube.com/watch?v=A9yyX1bb3lw&feature=related

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: Axaj
Date: 2009-02-01 20:45:46
#include <tigcclib.h>

// define the global constants
#define SPRITE_HEIGHT  8
#define LEFT        0
#define RIGHT      1

void _main(void) {
    // declare the sprite positions
    int x1 = 20, y1 = 25, direction1 = RIGHT;
    int x2 = 40, y2 = 50, direction2 = LEFT;
    int x3 = 80, y3 = 75, direction3 = RIGHT;

    // keycode variable
    int key = 0;

    // declare the sprites (8,16,32) pixels wide x 8 pixels tall
    unsigned char sprite1[] = {0xC3,0x3C,0xC3,0x3C,0xC3,0x3C,0xC3,0x3C};
    unsigned short int sprite2[] = {0xFFFF,0xFFFF,0x0FF0,0xF00F,0x0FF0,0xF00F,0xFFFF,0xFFFF};
    unsigned long int sprite3[] = {0xFFFFFFFF,0xFF0000FF,0xFF0000FF,0xFF0000FF,
                    0xFF0000FF,0xFF0000FF,0xFF0000FF,0xFFFFFFFF};

    // clear the screen
    ClrScr();

    // print the control information strings
    DrawStr(0, 0, "Press 1, 2, or 3", A_NORMAL);
    DrawStr(0, 10, "to move the sprites!", A_NORMAL);

    // draw the sprites
    Sprite8(x1, y1, SPRITE_HEIGHT, sprite1, LCD_MEM, SPRT_XOR);
    Sprite16(x2, y2, SPRITE_HEIGHT, sprite2, LCD_MEM, SPRT_XOR);
    Sprite32(x3, y3, SPRITE_HEIGHT, sprite3, LCD_MEM, SPRT_XOR);

    // wait until the user presses ESC
    while ((key = ngetchx()) != KEY_ESC) {
        // if the user pressed 1
        if (key == '1') {
            // remove the 8-bit sprite
            Sprite8(x1, y1, SPRITE_HEIGHT, sprite1, LCD_MEM, SPRT_XOR);

            // alter the sprite's position
            if (direction1 == LEFT) {
                x1-=20;

                if (x1 < 10) {
                    x1+=40;
                    direction1 = RIGHT;
                }
            } else {
                x1+=20;

                if (x1 > (LCD_WIDTH - 8)) {
                    x1-=40;
                    direction1 = LEFT;
                }
            }

            // redraw the sprite at the new position
            Sprite8(x1, y1, SPRITE_HEIGHT, sprite1, LCD_MEM, SPRT_XOR);

        // if the user pressed 2
        } else if (key == '2') {
            // remove the 16-bit sprite
            Sprite16(x2, y2, SPRITE_HEIGHT, sprite2, LCD_MEM, SPRT_XOR);

            // alter the sprite's position
            if (direction2 == LEFT) {
                x2-=15;

                if (x2 < 10) {
                    x2+=30;
                    direction2 = RIGHT;
                }
            } else {
                x2+=15;

                if (x2 > (LCD_WIDTH - 16)) {
                    x2-=30;
                    direction2 = LEFT;
                }
            }

            // redraw the sprite at the new position
            Sprite16(x2, y2, SPRITE_HEIGHT, sprite2, LCD_MEM, SPRT_XOR);

        // if the user pressed 3
        } else if (key == '3') {
            // remove the 32-bit sprite
            Sprite32(x3, y3, SPRITE_HEIGHT, sprite3, LCD_MEM, SPRT_XOR);

            // adjust the sprite's position
            if (direction3 == LEFT) {
                x3-=10;

                if (x3 < 10) {
                    x3+=20;
                    direction3 = RIGHT;
                }
            } else {
                x3+=10;

                if (x3 > (LCD_WIDTH - 32)) {
                    x3-=20;
                    direction3 = LEFT;
                }
            }

            // redraw the sprite at the new position
            Sprite32(x3, y3, SPRITE_HEIGHT, sprite3, LCD_MEM, SPRT_XOR);
        }
    }
}

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: Thomas
Date: 2009-02-01 21:17:09
Yeah man, I tell ya what, man, that dang ol? internet, man, you just go in on there and point and click, talk about w-w-dot-w-com, mean you got nekkid chicks on there, man, just go click, click, click, click, click, it?s real easy, man.


lol I had a King of the Hill quote

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: ?????(000)
Date: 2009-02-02 01:30:51
http://cardboardspaceshiptoys.com/shop/images/friendswithyou%20burger.jpg

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: ultraVex
Date: 2009-02-02 16:29:27
SOPRTS!

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: ?????(000)
Date: 2009-02-03 02:42:40
.

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: Axaj
Date: 2009-02-04 09:40:25
http://glitchcity.info/images/retards.png

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: ?????(000)
Date: 2009-02-04 10:57:01
wikipedia

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: Axaj
Date: 2009-02-04 21:13:16
#include <tigcclib.h>

// a VERY simplified version of a sprintf() function
int sprintf2(char *str, const char *literal, const char *args) {
    int length = 0;

    // loop until we find the terminator
    while (*literal != 0) {
        if (*literal == '%') {
            // we have a format specifier
            // increment the literal string position
            literal++;

            if (*literal == 'd') {
                // we have an integer
                *str = 'i';
                *++str = 'n';
                *++str = 't';

                // it's too hard to convert
                // so we'll just pretend by skipping
                // the integer bytes
                args+=4;

                length+=3;
            } else if (*literal == 's') {
                // we have a string
                while (*args != 0) {
                    // loop till we find the string terminator
                    *str++ = *args++;
                    length++;
                }

                // make sure we aren't past the end
                str–;
                args++;
            } else if (*literal == '%') {
                *str = '%';

                length++;
            } else {
                *str = 'm';
                *++str = 'i';
                *++str = 's';
                *++str = 'c';

                // assume all other types
                // take 1 byte
                args++;

                length+=4;
            }

            str++;
            literal++;
        } else {
            // regular character
            *str = *literal;
            str++;
            literal++;
            length++;
        }
    }

    // terminate the string
    *str = 0;

    return length;
}

// Main Function
void _main(void) {
    int length;
    char string[80];

    // clear the screen
    clrscr();

    // format the string
    length = sprintf2(string,"Test %s. %s!!","String\x00QWERTY\x00");

    // print the string
    printf_xy(0,0,string);

    // format a new string
    length = sprintf2(string,"%d %f %% %m'isc'","0030FM");

    // print the new string
    printf_xy(0,10,string);

    // wait for user to press a key to exit the program
    ngetchx();
}

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: Ketsuban
Date: 2009-02-04 21:24:21
Why overload sprintf()?

My post:

Charizard 'M

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: ?????(000)
Date: 2009-02-05 10:17:23
Member+

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: Ketsuban
Date: 2009-02-05 10:26:27
http://www.youtube.com/watch?v=oHg5SJYRHA0

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: ?????(000)
Date: 2009-02-05 12:13:47
ht

Re: Press Ctrl+V or Cmd+V or whatever and post

Posted by: Guy
Date: 2009-02-07 09:43:27
Phoenix Wright: Justice For All [Case 2] (Part 19)