Forums

Topic: Petit Computer

Posts 4,141 to 4,160 of 9,620

InsertPi

I have a problem. I was coming up for a way for @swordx to save decimals in GRP files without using fractions when I came across a problem. Here's my code:

NUMBER=21.76 'Random number
NUMA=FLOOR(NUMBER)
NUMB-NUMBER-NUMA
NUMBL=LEN(STR$(NUMB))-2
NUMBL=POW(10,NUMBL)
NUMB=NUMB*NUMBL

It worked somewhat, but when I did 0.76*100, it returned 75.977. I don't know what is going on; it's supposed to return 76, not 75.977! What happened?

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

InsertPi

I also tried 0.98*100, but it returned 97.998. Petit computer glitch?

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

Ralph

@IAmAPerson620
I think it is just the way floating point numbers work. For example 0.98 would be 4014/4096 which is 0.97998 so what you are doing is multiplying 0.97998 by 100.

Edited on by Ralph

Ralph

InsertPi

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

swordx

WOAH! My game is leading for most excited about on the Wiki poll! That can't be right...Maybe the votes from Obliviation and Smash Unleashed went to my game by default...

swordx

Discostew

swordx wrote:

WOAH! My game is leading for most excited about on the Wiki poll! That can't be right...Maybe the votes from Obliviation and Smash Unleashed went to my game by default...

Well, my last demo was back in September 2012, so I'm not surprised by the number of votes for mine.
Sorry to throw memes into this, but "this isn't even my final form!".

Edited on by Discostew

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

swordx

Discostew wrote:

swordx wrote:

WOAH! My game is leading for most excited about on the Wiki poll! That can't be right...Maybe the votes from Obliviation and Smash Unleashed went to my game by default...

Well, my last demo was back in September 2012, so I'm not surprised by the number of votes for mine.

I'm surprised by your votes...You're the best PTC coder here!

swordx

Slayer

I might post up one of my games on the wiki. Gladiators is going fine but the button code isn't really being cooperative. I've put in:
IF B AND 16 THEN GOTO @STARTGAME
And I input this earlier:
B=BUTTON()
Maybe I should have put BTRIG, what am I doing wrong? Oh, maybe it's the sprites. Yeah, I didn't load those or make backgrounds... Back to work.

I have nothing really to say about myself.

Slayer

I am horrid at GRPbackgrounds... Anyone want to make those? Gladiator arena... Or maybe can I do a DRWED or a SCRED?

I have nothing really to say about myself.

Hairmanban19

swordx wrote:

WOAH! My game is leading for most excited about on the Wiki poll! That can't be right...Maybe the votes from Obliviation and Smash Unleashed went to my game by default...

Well,i voted for it,and i have a few friends that are excited for it,so they voted also.

...

3DS Friend Code: 3136-7615-5907

twinArmageddons

Hairmanban19 wrote:

@Twinarmageddonz how are the sprites for my game coming along?

sorry ive been busy i forgot about it oop
what sprites do you need

get in loser we're going titan hunting

3DS Friend Code: 2879-0639-8952 | Nintendo Network ID: merp_aottg

swordx

Hairmanban19 wrote:

swordx wrote:

WOAH! My game is leading for most excited about on the Wiki poll! That can't be right...Maybe the votes from Obliviation and Smash Unleashed went to my game by default...

Well,i voted for it,and i have a few friends that are excited for it,so they voted also.

Wow...THANK YOU SO MUCH! I didn't know people cared that much about my game...

swordx

ramstrong

slayer wrote:

I might post up one of my games on the wiki. Gladiators is going fine but the button code isn't really being cooperative. I've put in:
IF B AND 16 THEN GOTO @STARTGAME
And I input this earlier:
B=BUTTON()
Maybe I should have put BTRIG, what am I doing wrong? Oh, maybe it's the sprites. Yeah, I didn't load those or make backgrounds... Back to work.

You didn't say what your problem is exactly. If I have to guess, You may have some false logic in your program. Otherwise, you may have BUTTON(1), when you want BUTTON(0). BTRIG=BUTTON(1), and if you put in WAIT or VSYNC greater than one, there is a chance that you'll be missing button presses.

I did the whole BUTTON input across several postings. Goto my ramstrong blogspot and search for buttons and dpad
PS: You don't need THEN GOTO. IF () GOTO works fine.

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

InsertPi

What does BUTTON(0) mean? And what's te difference between BUTTON and BTRIG? (Noobish questions, I know...)

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

Ralph

@IAmAPerson620
Look up the "snailfacia.net" website for the function guide for information on BUTTON and BTRIG, it's really helpful.

Edited on by Ralph

Ralph

ramstrong

zorkzedork wrote:

@IAmAPerson620
Look up the "snailfacia.net" website for the function guide for information on BUTTON and BTRIG, it's really helpful.

Petit Computer Journal #3 deals with buttons and directional pad.

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

InsertPi

zorkzedork wrote:

@IAmAPerson620
Look up the "snailfacia.net" website for the function guide for information on BUTTON and BTRIG, it's really helpful.

Thx. I feel like a noob now... xD

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

Please login or sign up to reply to this topic