j Wrote:
> hi,
>
> can anybody tell me please why the linker keeps bringing up this error
> message? i am using the latest dmd 2.
>
> thank you
>
> OPTLINK (R) for Win32 Release 8.00.2
> Copyright (C) Digital Mars 1989-2009 All rights reserved.
> http://www.digitalmars.com/ctg/optlink.html
>
Is din.readf (from std.cstream in Phobos) able to read floats when using %s as
the format specifier?
When I used this:
din.readf( "%s", &somedouble );
somedouble will still be nan after receiving input from the user.
But when I use:
din.readf( "%f", &somedouble );
everything goes as planned.
Is th
BCS Wrote:
> Hello Michael P.,
>
> > I'm converting some C headers into D, and had some questions.
> > 1. What is the equivalent of a 'short int' in D?
> > e.g:
> > struct ScePspSRect {
> > short int x;
> > short int y;
> &
s32;
typedef int64_t s64;
Would it be okay to be make/alias all of the uintxx_t to 'uint' and all of the
intxx_t to 'int'?
P.S. If anyone is wondering, this is taken from the homebrew PSP SDK.
Thanks,
Michael P.
Daniel Keep Wrote:
>
>
> Michael P. wrote:
> > Okay, so I'm making a breakout type game in D. Using Derelict.
> > I have a 2d array of Block type variables(not important what's in them)
> > declared like this:
> > Block[][] level;
> > and
foreach( Block b; ba )
{
if( checkCollision( ball, b.p ) )
{
//remove the block??
}
}
}
The level array has 12 lines of 'x' amount of bricks. x can be as great as 10.
-Michael P.
bearophile Wrote:
.
>
> Try:
> import std.string: strip;
> ...
> highScoreList ~= toInt(strip(file[0 .. nextScore]));
>
> I have never understand the rationale of not ignoring whitespace inside the
> toInt, I think it's an ugly design.
>
> Bye,
> bearophile
That didn't work for me. Doing this
I've having some trouble reading from a file.
I am trying to read a list of high scores, each on a separate line, like this:
440
0
0
0
0
But with my code, I get an error saying: Error: conversion.
Code:
//Load high scores
char[] file;
int[] highScoreList;
int nextScore;
file = cast(char[])read(
Jarrett Billingsley Wrote:
> On Sun, May 10, 2009 at 10:17 PM, grauzone wrote:
>
> > The files are probably not readable (r) or executable (x) by all other users
> > (o). Try "chmod o+rx /usr/local/bin/dmd".
>
> Of course, prepend 'sudo' :|
That worked.
Thanks for everyone's help. :)
Michael P. Wrote:
> Mike Parker Wrote:
>
> > Michael P. wrote:
> > > Frits van Bommel Wrote:
> > >
> > >> Michael P. wrote:
> > >>> But when I type dmd in the terminal, I get this:
> > >>>
> > >>> mich...@u
Mike Parker Wrote:
> Michael P. wrote:
> > Frits van Bommel Wrote:
> >
> >> Michael P. wrote:
> >>> But when I type dmd in the terminal, I get this:
> >>>
> >>> mich...@ubuntu:~$ dmd
> >>> bash: /usr/local/bin/dmd
Frits van Bommel Wrote:
> Michael P. wrote:
> > But when I type dmd in the terminal, I get this:
> >
> > mich...@ubuntu:~$ dmd
> > bash: /usr/local/bin/dmd: Permission denied
> > mich...@ubuntu:~$
> >
> > Do you know why?
>
> Looks like y
Jesse Phillips Wrote:
>
> As for doing this by hand. The two directories you are interested in are
> src/ and linux/ the others are just manuals and other operating systems.
>
> copy the files found in linux/ to /usr/local/
>
> copy src/phobos to /usr/local/include/
>
> With this you'd need to
Okay, I've been trying to install DMD on Ubuntu for a while, but I just can't
get it. Is there an up to date guide on installing DMD on Ubuntu?
I'm new to Linux too. :P
I've tried quite a bit of googling, and found some stuff, but quite a bit of it
won't work with the latest release, where there
Spacen Jasset Wrote:
> Michael P. wrote:
> > Hey, I've started to do some of the problems on Project Euler to practice
> > my programming skills. I'm doing #10 right now, and I think I've got a
> > working solution. It's just that it'
Hey, I've started to do some of the problems on Project Euler to practice my
programming skills. I'm doing #10 right now, and I think I've got a working
solution. It's just that it's way too slow.
Here's the link:
http://projecteuler.net/index.php?section=problems&id=10
The code works fine with s
naama Wrote:
> How am I get a integer nimber from the user? (readln()?)
>
> the command line is:
> ???
import std.cstream;
int number;
din.readf( "%d", &number );
torhu Wrote:
> On 02.01.2009 22:21, Jarrett Billingsley wrote:
> > On Fri, Jan 2, 2009 at 2:17 PM, Michael P. wrote:
> >> Okay, so right now, I'm making a small game(Mario) using DAllegro. I use
> >> build, and every time, I have to type this in to compile my
Jarrett Billingsley Wrote:
> On Fri, Jan 2, 2009 at 2:17 PM, Michael P. wrote:
> > Okay, so right now, I'm making a small game(Mario) using DAllegro. I use
> > build, and every time, I have to type this in to compile my progress:
> >
> > build mario alleg.lib
&g
Okay, so right now, I'm making a small game(Mario) using DAllegro. I use build,
and every time, I have to type this in to compile my progress:
build mario alleg.lib
Now, I know it's not a lot of typing. But considering I type mario wrong every
so often, and I generally want to execute it after,
>Well, let's go through the code.
>
> First of all, you should undestand that an array is nothing but a pair of
> pointer to first element and its length.
>
> Since char[] == string in D1, let's use string instead to make code slightly
> more readable.
>
> string[] names; // array of strings t
Denis Koroskin Wrote:
> On Tue, 30 Dec 2008 20:23:07 +0300, Michael P. wrote:
>
> > Denis Koroskin Wrote:
> >
> >> On Tue, 30 Dec 2008 18:56:08 +0300, Michael P.
> >> wrote:
> >>
> >> > Jarrett Billingsley Wrote:
> >> >
Denis Koroskin Wrote:
> On Tue, 30 Dec 2008 18:56:08 +0300, Michael P. wrote:
>
> > Jarrett Billingsley Wrote:
> >
> >> On Mon, Dec 29, 2008 at 10:36 PM, Michael P.
> >> wrote:
> >> > import std.stdio;
> >> > import std
Jarrett Billingsley Wrote:
> On Mon, Dec 29, 2008 at 10:36 PM, Michael P. wrote:
> > import std.stdio;
> > import std.cstream;
> > void main()
> > {
> > char[][] names;
> > char[] currentName;
> > while( true )
> > {
> >d
//names array? new statement? .length?
}
}
foreach( name; names )
{
writefln( name );
}
}
How would I go about dynamically allocating memory for the names array in the
part that I commented?
I'm not really sure about the dynamic array details in D, this is just an
example to help.
-Michael P.
j = 0; j < NUMBER_OF_TILES_HEIGHT; j++ )
{
tiles[ i ][ j ] = cast( char )( rand() & TYPES_OF_TILES );
//occurs here
}
}
So, I'm not really sure why it's happening Anyone mind shedding some light
on why?
-Michael P.
Michael P. Wrote:
> Okay, I'm getting an array bounds error, and I have no clue why. Here is the
> code that affect it:
>
> //Constants
> const int SCREEN_WIDTH = 640;
> const int SCREEN_HEIGHT = 480;
> const int TILE_WIDTH = 20;
> const int TILE_HEIGHT = 20; //h
Mike Parker Wrote:
> Michael P. wrote:
> > BCS Wrote:
> >
> >> Reply to Michael P.,
> >>
> >>> I'm getting an undefined reference error with Derelict and SDL.
> >>> I tried to create an SDLImage class, but I got an error when the fi
BCS Wrote:
> Reply to Michael P.,
>
> > I'm getting an undefined reference error with Derelict and SDL.
> > I tried to create an SDLImage class, but I got an error when the files
> > try to link together.
> > I've attached the two .d files in a rar.
>
have compiled other SDL programs, so everything is set up properly with
Derelict.
-Michael P.
Error Package.rar
Description: application/rar
30 matches
Mail list logo