Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Printing a score

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Printing a score
Paul Pridham
Member #250
April 2000
avatar

No, I bet Peter was referring to Lua. ;)

Thomas Fjellstrom
Member #476
June 2000
avatar

Lua's not bad. But Im addicted to perl. ;) maybe when there exists a language that is as powerfull as C and as powerfull/timtowtdi/easy as perl is i might switch. :)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Peter Wang
Member #23
April 2000

Bob has heard my rants a little more :-) I was thinking of Scheme (a cleaned up dialect of Lisp). I like Lua too, which is getting to be more like Scheme (Pascal-like syntax for people who can't understand the beauty of brackets ;-)

But naming a specific language only detracts from what I wanted to say in my previous post. Don't use unnecessarily low level languages if you can avoid it.

And now I'm going to get flamed.

Johnny13
Member #805
October 2000
avatar

Quote:

I'm trying to write a simple pong-type game.My question is,how do you output an integer?!

Printing a Score related to Perl?Lisp?:o
does that game will be run on a Web server?
it's not a security forum. Bob don't scare him(and me)!

Alg3D Praise my Games!!<code>#define SPAMMER (post>=666&&postperday>=6)</code><Mr.spellcaster>What post? <Mr.spellcaster>A useful post by me.

spellcaster
Member #1,493
September 2001
avatar

All he said was:
>>Don't use printf(string), use printf("%s", string)<<

Which is absolutely correct. An even without the security implications (If I can enter the string in the game, I could also simply turn the power button... no need to screw the stack here) - you don't want to have gibberish on the screen.

And if I recall correctly, printf is defined to take a "format" string as 1st and then the output strings as second paramter. So, if you don't supply a format string, it's your fault.

And I think playing safe is something we all should do in all of our programs.
(Guess I should add some more return value checks to my programs, now)

Side note:
How do I: supply an function using the string and then push the address to that function onto the stack?
Sounds faszinating. Can I use this for scripting purposes?

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Bob
Free Market Evangelist
September 2000
avatar

spellcaster: no, the format string will be taken as the "string" parameter. You just won't have any params. This is equivalent to writting printf("hi!"); The problems come from you write printf("Hi%i!");...

--
- Bob
[ -- All my signature links are 404 -- ]

 1   2 


Go to: