Smiley Face

Started by
7 comments, last by logicpill 21 years, 5 months ago
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.
"Classes will dull your mind destroy the potential for authentic creativity"
Advertisement
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.
If you record a .AVI file and play it. That would be pretty easy, but you need a .AVI editor.

>>>>>>>>>>>>>>>>>
Ilthigore
<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<
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.
"Classes will dull your mind destroy the potential for authentic creativity"
What kind of libraries can you use? OpenGL? Some kind of AVI library? libMNG? Does it have to be interactive at all? More details would be nice, too.
SpiffGQ
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);
}


"To some its a six-pack, to me it's a support group."
This is easier:


  #include <stdio.h>int main() {	printf("^_^\n");	printf("-_^\n");	printf("^_^\n");	return 0;}  
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]
quote:Original post by Programmer One
Pouya....that doesn''t wink...

Well, yours isn''t yellow either


This topic is closed to new replies.

Advertisement