Really big bug: hugo won't print numbers

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Really big bug: hugo won't print numbers

Post by Tdarcos »

I noticed this when I was trying to print the street number, that they weren't showing up. So I tried a test program, X.hug:

Code: Select all

global X
routine main
{
print "Start "; 5
x = 8
print "Second item "; x
}
With no words it prints nothing; with the words it prints the words but not the numbers. It doesn't print the numbers at all. This is weird.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

You have to use the number token:

Code: Select all

global X
routine main
{
print "Start "; number 5
x = 8
print "Second item "; number x
}
Otherwise, it thinks you are referring to an object number.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

Roody_Yogurt wrote:You have to use the number token:

Code: Select all

global X
routine main
{
print "Start "; number 5
x = 8
print "Second item "; number x
}
Otherwise, it thinks you are referring to an object number.
Thanks! I'll try that; It was pissing me off, I was afraid my work on this game was going to be wasted. I had stopped working on City of Zenith because of this number problem; if numbers couldn't be displayed the Hugo game system was worthless.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Ice Cream Jonsey
Posts: 28879
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

Well, we're all really glad you checked back in. We NEED this game, and I am willing to beta-test.
the dark and gritty...Ice Cream Jonsey!

User avatar
Flack
Posts: 8822
Joined: Tue Nov 18, 2008 3:02 pm
Location: Oklahoma
Contact:

Post by Flack »

Wouldn't be odd if, in all the years that Hugo has been out, and all the authors that had programmed using it, and all the games that had been created with it, and all the people who had played those games, that no one had ever tried printing a number?
"I failed a savings throw and now I am back."

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

Flack wrote:Wouldn't be odd if, in all the years that Hugo has been out, and all the authors that had programmed using it, and all the games that had been created with it, and all the people who had played those games, that no one had ever tried printing a number?
Look, Flack, it doesn't mention this in the goddam manual. And people might simply have worked around it. Internally, you can't print a number anyway. You have to write a routine to change it into the component digit string it represents, then print that string. There can be assist packages such that some machine instructions do the translation for you, but the translation has to be done before a number can be written, unless you're going to write it as the raw binary value it actually is.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Actually, it's mentioned on page 58 of the Hugo Book (page 68 according to the PDF reader) in the section about printing stuff. I'd be lying if I said I never ran into the same problem, though.

Post Reply