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.
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.
@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.
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.
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...
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!".
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!
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.
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.
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...
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.
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.
@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.
Forums
Topic: Petit Computer
Posts 4,141 to 4,160 of 9,620
Please login or sign up to reply to this topic