| www.delorie.com/archives/browse.cgi | search |
| From: | "Al Amzeen (Alexandr Amzin)" <amzeen AT mtu-net DOT ru> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: randomize |
| Date: | Sun, 23 Apr 2000 20:25:28 +0400 |
| Organization: | Fidolook Express page http://fidolook.da.ru |
| Lines: | 21 |
| Message-ID: | <8dv8ia$1m8r$1@gavrilo.mtu.ru> |
| References: | <ngEM4.858$Q_2 DOT 185545 AT carnaval DOT risq DOT qc DOT ca> |
| NNTP-Posting-Host: | ppp97-131.dialup.mtu-net.ru |
| X-Trace: | gavrilo.mtu.ru 956507531 55579 212.188.97.131 (23 Apr 2000 16:32:11 GMT) |
| X-Complaints-To: | usenet-abuse AT mtu DOT ru |
| NNTP-Posting-Date: | 23 Apr 2000 16:32:11 GMT |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Newsreader: | Fidolook Express V1.51rus for MS OE 5.0 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Greetings, Yannick Benoit <yannick DOT benoit AT dr DOT cgocable DOT ca>! You wrote:
> hey,
> is there a way to use randomize(); with allegro ?
of course there is.
use this code:
#include <bios.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
/* time.h for any case... :) */
main () {
srandom(biostime(0,0));
/* from 0 to 8 */
int rand_num=random()%9;
printf ("Random number:%d\n",rand_num);
}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |