SEAL Forum Index SEAL
The SEAL Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to randomize it?

 
Post new topic   Reply to topic    SEAL Forum Index -> Programming Related
View previous topic :: View next topic  
Author Message
lakamas



Joined: 02 Jun 2002
Posts: 9

PostPosted: Sat Jul 13, 2002 3:41 am    Post subject: how to randomize it? Reply with quote

in a game i am making i want to make some bmp pics (with names c1,c2...c13)to apear on the screen in random order.
i use blit(pic,..,..,...,..); and i try to use pic1[0]=('c'(rand() %13));
but it didn't workout so if anyone knows another way to do it
and have a litle time plz answer.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Finkelsmak Kvasthuvud



Joined: 21 Apr 2002
Posts: 85
Location: Sweden

PostPosted: Sat Jul 13, 2002 4:50 am    Post subject: Reply with quote

I would do it like this...

pic1[0] = set_format_text (NULL, "c%d", rand() %13 + 1);

but, on the other hand, I know almost no C so there are probably better ways. it works though...
Back to top
View user's profile Send private message Visit poster's website
_xduffy_
Administrator


Joined: 15 Mar 2002
Posts: 894
Location: Sweden

PostPosted: Sat Jul 13, 2002 2:24 pm    Post subject: Reply with quote

True, you can't do it the way lakamas tried to..
_________________
http://xduffystuff.sourceforge.net/Desktop/
www.xduffy.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
lakamas



Joined: 02 Jun 2002
Posts: 9

PostPosted: Mon Jul 15, 2002 4:49 am    Post subject: thanks for your the help Reply with quote

thanks for your the help i tried it but i still have problem
when i compile it the compiler puts a message:
Error:undefined reference to 'set_format_text'
do i have to use a librarie or something else for the compiler to don't have problem.
if you know anything else and you have time pleaze let me know
thanks anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Finkelsmak Kvasthuvud



Joined: 21 Apr 2002
Posts: 85
Location: Sweden

PostPosted: Mon Jul 15, 2002 7:21 am    Post subject: Reply with quote

I think as long as you have seal.h included it should work. I just supposed it was a Seal-application... if it's not. I don't know how to do it. Maybe some of the C-wizards around here could help you...?

#include <seal.h>
Back to top
View user's profile Send private message Visit poster's website
_xduffy_
Administrator


Joined: 15 Mar 2002
Posts: 894
Location: Sweden

PostPosted: Mon Jul 15, 2002 10:31 am    Post subject: Reply with quote

I suggest that you include stdio.h and use sprintf()...
A very good function

And no, I'm certainly no wizard
_________________
http://xduffystuff.sourceforge.net/Desktop/
www.xduffy.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
biggyp



Joined: 16 Oct 2001
Posts: 1473
Location: England, United Kingdom

PostPosted: Wed Jul 17, 2002 2:22 am    Post subject: Reply with quote

more of a sourceror
_________________
http://www.theopencd.org/ - OpenSource for the Masses

Gallery

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
_xduffy_
Administrator


Joined: 15 Mar 2002
Posts: 894
Location: Sweden

PostPosted: Wed Jul 17, 2002 9:19 am    Post subject: Reply with quote

Probably, yes Mr Green
_________________
http://xduffystuff.sourceforge.net/Desktop/
www.xduffy.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
lakamas



Joined: 02 Jun 2002
Posts: 9

PostPosted: Thu Jul 18, 2002 12:32 am    Post subject: Reply with quote

thanks for the "help"
i have solved the problem.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    SEAL Forum Index -> Programming Related All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group