Archived

This topic is now archived and is closed to further replies.

Noxxid

Smiley Face

Recommended Posts

Can anyone tell me the shortest way to make a yellow smiley face where one of the eyes blinks(in C++). This was a project for the programing class I''m in. I have already done it all ,but it seems there should be a shorter way of doing it. Any and all suggestions would be helpful.

Share this post


Link to post
Share on other sites
Why don''t you post your current solution so we will know how far you have already gotten and can give you pointers?


This post qualifies for 100 per cent Canadian Content under the rulings of the Canadian Internet Commission and the Federal Ministry of Communication. There are four Americans who worked on this post, but they all have landed immigrant status, and have signed CRTC affidavits swearing that they drink beer, eat back bacon, drive snowmobiles and wear toques. Any resemblance between the Content of this post and the content of any American post is purely coincidental and not the intention of the poster or the various Internet Agencies of the Canadian Government who have screened these posts prior to bulk erasing in accordance with the policies of the Federal Internet Identity Board.

Share this post


Link to post
Share on other sites
Hmm I don''t remember all the code for it. The program is on a computer at my school. Guess I''ll have to wait until Monday to get it and post. Oh well I''ll start this up again when I get the code.

Share this post


Link to post
Share on other sites
Get SDL and do something like this:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include <SDL.h>

SDL_Surface*Screen;
SDL_Surface*smile1;
SDL_Surface*smile2;
SDL_Rect Dest;

int main(int argc, char *argv[])
{

SDL_Init(SDL_INIT_VIDEO);
surScreen = SDL_SetVideoMode(64, 64, 16, 0)
smile1 = SDL_LoadBMP("smile_openeye.bmp");
smile2 = SDL_LoadBMP("smile_closedeye.bmp");


dest.x = 0;
dest.y = 0;

while(true)
{
SDL_BlitSurface(smile1, NULL, Screen, &Dest);
SDL_Flip( surScreen );
for(int i=0;i<100000;i++);
SDL_BlitSurface(smile2, NULL, Screen, &Dest);
SDL_Flip( surScreen );
for(int i=0;i<100000;i++);
}

SDL_FreeSurface(smile1);
SDL_FreeSurface(smile2);
}


Share this post


Link to post
Share on other sites
Pouya....that doesn't wink...


    
#include <stdio.h>

int main()
{
printf("^_^");
while (true)
{
printf("\b-");
Sleep(1000);
printf("\b^");
Sleep(1000);
}
return 0;
}


*cough*

LibGDN - By developers, for developers

[edited by - Programmer One on November 3, 2002 11:24:44 PM]

Share this post


Link to post
Share on other sites