-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|52|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-




mike_g

large numbers in blitz...

27th March 2008

Maybe search the blitz archives to see if anyone has made a bignum library. Then there should be pretty much no limitation on the size of the number.
If you are going to code your own then you will need to write methods for each operation. I started on my*snip*


mike_g

is string a number?

24th March 2008

From what I have read the characters 0-9 are contiguous in all character sets, A-Z is not however. Tbh I cant think of what other portability problems there would be with it. Still isdigit, isspace, isalpha, etc are not exactly hard to use. oh, and I chang*snip*


mike_g

is string a number?

24th March 2008

Ok I thought I'd have a go at coding my own version. Its a little obfuscated, but should cover all cases:
[code]int isNumber(char *s)
{
int dot = 0;
int num = 0;
if(*s == '-')s++;
if(! *s)return 0;
while(*s)
if(*snip*


mike_g

is string a number?

24th March 2008

[quote="Afr0"]Though JL235's example probably works, remember you can also use typeof() (built-in operator in both C and C++) to check wether a part of a string is a char or an int or whatever.[/quote]
The only built in operator I know that sounds like th*snip*


mike_g

is string a number?

24th March 2008

Firstly, I wouldent use atoi because strtol has better error handling. Its definitely worth getting in the habit of using especially if you want to parse text, as the end pointer leaves you where you left off last iteration.
The way I intended was a bit d*snip*


mike_g

is string a number?

23rd March 2008

strtol will convert a string to a number for you, and you can see if it was a valid number, by checking where the end pointer ends up.
(Linkage)


mike_g

Stupid question....

17th March 2008

Yet another way:
[code]if KeyHit(46) cc = cc Xor 1[/code]


mike_g

Fruit Machine game

11th March 2008

Whoops, looks like I got a bit confused there o_0 Still getting the time will come in handy for seeding randomisation anyhow.


mike_g

Fruit Machine game

11th March 2008

Maybe take a look in the PA lib documentation. I'm pretty sure it should feature some method of getting the time but I dont know as I never used it myself. If not maybe look up gettimeofday and code your own ticker. Its a portable way to get the time, but *snip*


mike_g

Pandoras's Box.

10th March 2008

I had a poke about with one in PC world. I wernt too keen on feel of the OS. All the files and the terminal seemed to be hidden away; took about 5 minutes for me to find it. If I get one I'll probably shove X/Ubuntu on it, there seems to be no problems wit*snip*


mike_g

Pandoras's Box.

10th March 2008

[quote]Just recently I splashed out for an Asus Eee PC, but now I hear a new model is in the works - with a larger screen and expanded memory. D'oh![/quote]
I'm planning on getting one of them. Maybe I should wait for the new version, as the tiny *snip*


mike_g

arrays within types...

10th March 2008

Yes, its possible to have an array inside a type in Blitz3D. you have to use box brackets though and you don't declare it as a dim. Example:
[code]Type thing
Field array[10]
End Type
t.thing = New thing
For i = 1 To 10
t\\array = i*5
Next
For i = *snip*


mike_g

best way to save data to a file...

10th March 2008

Yes, thats a nice thing about XML. However I wouldent recommend it for a game thats storing large sets of data as the tags create a hell of a lot of bloat.
You can read any file in pretty much any language as long as you know how its structured, and that *snip*


mike_g

QOTD : BitTorrent vs Hard drives

9th March 2008

Have you done defrag recently? If not that should speed things up. Fragmentation results in excessive read head movement.


mike_g

The Top 10 Side Scrolling Beat-Em-Ups

29th February 2008

Revenge of Shinobi FTW!


mike_g

Malloc

3rd February 2008

Ok cool, for some reason I assumed you were reading from a file.
To get user input I'd use fgets as it prevents buffer overflows. Basically I'd have a local predetermined array to get the input to. Something like:
[code]char input[1000];
fgets(input, 10*snip*


mike_g

Malloc

3rd February 2008

Well first off if you want to use malloc you will need to include stdlib.h
Then theres a bit of a problem with the way you are using malloc. You are only doing allocation when userin == NULL, however you never initialized it as such nor set to it, also fo*snip*


mike_g

file access?

19th January 2008

Tbh it doesent really matter too much. Most video formats tend to be interlaced. You could interlace your movie file, or use an interlaced format. This would then be read sequentially as a bit of video, bit of audio, video, audio, etc.
[quote]No problem w*snip*


mike_g

Hillary Clinton for New Hampshire? :\\

9th January 2008

Maybe I did get a bit carried away, but it was only to highlight a point. I have a friend thats going into the army because he lost his drivers license, and apparently the army will get it back for him and some other stuff. I still call him a retard for do*snip*


mike_g

Hillary Clinton for New Hampshire? :\\

9th January 2008

So would you say that invading Iraq has made the world a safer place?
Maybe I neglected the world wars (they are from before my time), but the wars we are in now are uncalled for, and blatantly were from the start.
America elected a president for reveng*snip*


mike_g

Hillary Clinton for New Hampshire? :\\

9th January 2008

I'm not going to get involved in politics; they are all a load of retards.
But I am a little concerned about violence in games. I love UT and other violent games, but there is a clear distinction that they are not real.
I have been playing call of duty *snip*


mike_g

TCP or UDP

22nd December 2007

[quote]Absolute bullocks![/quote]
I was not exactly wrong, just a bit vague :p


mike_g

How is everyone?

21st December 2007

Well its been emotional, but could you please calm down now? Seriously it gets tedious when every time I come here theres you going berserk because you have misinterpreted or taken offense by some trivial little thing.


mike_g

Loading B3D Mesh into Freebasic

21st December 2007

I'm pretty sure that you can use OpenGL with freebasic. I dont know how you would go about loading a B3D mesh with it tho. You might get better help if you try posting on the DBF boards as theres quite a lot of Freebasic coders there.


mike_g

TCP or UDP

20th December 2007

UDP is faster as there is no reply when you send data that way. For most situations TCP is better. There should be little difference in how easy they are to use.

Newer Posts More - Older Posts