DSiWare Forum

Topic: Petit Computer

Showing 301 to 320 of 9,296

AuthorMessage
Avatar

DrKarl

301. Posted:

Fidgit wrote:

Don't be surprised if it ends up with more confusion and questions.

No worries. :) One step at a time.

I love Yahtzee. A touch screen version would be awesome, even if it is just a solitaire experience for high score.

DrKarl

AuthorMessage
Avatar

ejamer

302. Posted:

DrKarl wrote:

ejamer wrote:

No - the original print statements should be fine.

[/div]

Regardless, the ; is not necessary. Also, I feel that it is important to get in the habit of using str$ when printing integers. What if the programmer needs to tack additional text after the integer is printed? They will need to have wrapped the integer in str$ in order to do so.

[/div]

Using the STR$() function is a fine idea. I'm not suggesting otherwise. But it's not necessary.
If you want to add additional text after the integer, you can use the same format:

PRINT "text ";INTEGER;" more text"

The key is using the semi-colon between each change in datatype.

I am not seeing this. Did you scan my QR code? If you just typed in the code, perhaps you made a typo? If you hold down A, do numbers just keep flickering by? With my machine here, holding down A only produces the numbers once.

Used your code to test, via the QR code, but the observation was based on my own experience. You won't (normally) see it happen because the code executes extremely quickly - there is virtually no visible sign outside of a minor flicker. It happens though: add the line of code I posted in my edit and test for yourself.

The full cycle of code is very likely to run multiple times when you press the button, meaning the dice will be rolled and printed multiple times. In most cases this won't matter, but sometimes you might want to perform an action exactly once in response to a button press.

Also, if nitpicking about what you probably should do then:

  • use IF-GOTO structure instead of IF-THEN GOTO
  • likely smarter to take button input as a variable and then process the variable with IF statements instead of reading a new button
  • use a VSYNC 1 statement before the BTRIG statement to avoid the duplication error

I'll post in a corrected QR code shortly.

Untitled

Edited on by ejamer

ejamer

AuthorMessage
Avatar

RudysaurusRex

303. Posted:

I was wanting this game, then I saw some of the posts... Dakrap is this and how do you use it?

Edited on by Unca_Lz

Wibbely-wobbely timey-wimey.
Pokemon W2 FC: 5415 8785 0283
My Awesomloggery
The best troll thread ever

Twitter: rudydog13

AuthorMessage
Avatar

DrKarl

304. Posted:

ejamer wrote:

PRINT "text ";INTEGER;" more text"

The key is using the semi-colon between each change in datatype.

Good to know. Thanks!

ejamer wrote:

Add the line of code I posted in my edit and test for yourself.

  • use a VSYNC 1 statement before the BTRIG statement to avoid the duplication error

Right you are. The VSYNC1 before the BTRIG's does the trick. Now I know what the manual was getting at. It wasn't clear that the sync needs to happen prior to the BTRIG.

DrKarl

AuthorMessage
Avatar

DrKarl

305. Posted:

ejamer wrote:

  • use IF-GOTO structure instead of IF-THEN GOTO

What's the advantage to this? I noticed that for anything but GOTO's and GOSUB's, the THEN statement is required. Does it hurt anything else other than reducing the available characters for the line by 5?

DrKarl

AuthorMessage
Avatar

ejamer

306. Posted:

ejamer wrote:

  • use IF-GOTO structure instead of IF-THEN GOTO

What's the advantage to this? I noticed that for anything but GOTO's and GOSUB's, the THEN statement is required. Does it hurt anything else other than reducing the available characters for the line by 5?

I don't know how they put the interpreter together, but in theory this should be a little bit quicker. Like, an extremely tiny bit quicker. Like, you probably won't see the difference unless it happens a huge number of times. In practice, I can't see it really mattering for virtually anyone using this program.

I also don't know how to do italics on these boards.

(Also, I thought this only works with IF-GOTO, not IF-GOSUB. I could be wrong and can't test right now.)

EDIT: Ok, I tested and couldn't find any difference in terms of performance. So this it looks like this change will just reduce the length of your code a bit.

Edited on by ejamer

ejamer

AuthorMessage
Avatar

Moorpheel

307. Posted:

rudydog13 wrote:

I was wanting this game, then I saw some of the posts... Dafuq is this and how do you use it?

We have been discussing its use in pretty much every comment.
Reading every comment posted in this thread should be as good as reading a tutorial :P

Moo

Oh look! A Morphloggery.
Oh! eShop Gurus.

3DS Friend Code: 0173-1330-0080 | Nintendo Network ID: Abgarok

AuthorMessage
Avatar

DrKarl

308. Posted:

ejamer wrote:

(Also, I thought this only works with IF-GOTO, not IF-GOSUB. I could be wrong and can't test right now.)

I think you are correct that it is IF-GOTO only. I looked again and I was confusing it with ON-GOSUB.

Regarding ON-GOSUB, I can't make sense on how to use it from the manual entry. It looks like a way to do switch type statements, but I can't grok the syntax. Does anybody have an example scenario where this would be useful?

Sidenote on italics: encase an i between a left and right bracket. Type your italics text. Then do a /i within another left and right bracket to stop italics.

DrKarl

AuthorMessage
Avatar

Moorpheel

309. Posted:

ON-GOSUB/GOTO

It works in this way (writing by memory, I could have something wrong):
You have a numeric variable X and you use:
ON X GOSUB @sub,GOSUB @sub2, GOSUB @sub3

What it really does:

If X==0 THEN GOSUB @sub
If X==1 THEN GOSUB @sub2
If X==2 THEN GOSUB @sub3

It is useful for things like menus.

Edited on by Moorpheel

Moo

Oh look! A Morphloggery.
Oh! eShop Gurus.

3DS Friend Code: 0173-1330-0080 | Nintendo Network ID: Abgarok

AuthorMessage
Avatar

Retro_on_theGo

310. Posted:

So can this thing handle 16-bit sprites? I THINK I saw a game or two that had them, but they were so basic.

"When freaky aliens give you lemons, make freaky alien lemonade!" -Hades 3DS FC: 5026-4421-7593
Black 2 FC: 0605 4087 9952 My Backloggery
My Colors! 3D Gallery

AuthorMessage
Avatar

neoxid500

311. Posted:

Umm... help on making AI >.<
I can't have a shooter game without proper AI =D

neoxid500

AuthorMessage
Avatar

Wheels2050

312. Posted:

neoxid500 wrote:

Umm... help on making AI >.<
I can't have a shooter game without proper AI =D

You'll need to figure out what you want the AI to DO before you code it up. Do you want enemies to chase the player? Shoot at the player? Move in a set pattern? Once you figure that out, write a little flow diagram (i.e. just the algorithm, no actual code) and finally translate that to BASIC.

I used to have a blog link here. I'll put it back up when the blog has something to read.

AuthorMessage
Avatar

DrKarl

313. Posted:

Morphtroid wrote:

It works in this way...

That makes perfect sense. I will give it a try. Thank you.

Edited on by DrKarl

DrKarl

AuthorMessage
Avatar

ejamer

314. Posted:

neoxid500 wrote:

Umm... help on making AI >.<
I can't have a shooter game without proper AI =D

As mentioned above, the question is too general. Try giving some background information and then asking something more specific. When you are ready to ask code-specific questions, post a QR code of what you already have in place.

If you are looking for suggestions about how to create an AI, well... start by writing down ideas of what you want each different enemy to do. Will they rush towards your character, or try to keep their distance? Will they target your ship directly, shoot indiscriminately in known directions, or shoot slightly off-target to add some randomness? At the start, very simple AI is probably your best bet with levels designed around set patterns instead of intelligent enemies that appear randomly. Complex behavior can be created by layering a series of simple decision onto each other... so start simple and work your way up.

ejamer

AuthorMessage
Avatar

Retro_on_theGo

315. Posted:

Retro_on_theGo wrote:

So can this thing handle 16-bit sprites? I THINK I saw a game or two that had them, but they were so basic.

[/div]

So I couldn't find a yes or no via googling, but it seems like the answer is yes. Has anyone tried. I'm mainly worried using 16-bit sprites would make the game harder to program? I'd rather use those kind of sprites than 8-bit for this game I've had in my head for a while now.

Edited on by Retro_on_theGo

"When freaky aliens give you lemons, make freaky alien lemonade!" -Hades 3DS FC: 5026-4421-7593
Black 2 FC: 0605 4087 9952 My Backloggery
My Colors! 3D Gallery

AuthorMessage
Avatar

zezhyrule

316. Posted:

It's just a style retro... has nothing to do with the amount of bits. Not sure if you're referring to sprite size or color palette but it can vary ofc.

[15:36] Corbs: Vita rules - 3DS drools!

zezloggery | i haz youtube | PSN ID: zezhyrule

[23:11] PhoenixCake: my brother is such a dope >___>.

AuthorMessage
Avatar

Retro_on_theGo

317. Posted:

But either way it's just a style, you're saying. Well ok then. I've procrastinated on buying this game long enough. Guess I'll go ahead and download it today. Work on learning it little by little. Thanks, I guess, zez. D:
Edit: I was referring to the color palate if you were still wondering. u_u

Edited on by Retro_on_theGo

"When freaky aliens give you lemons, make freaky alien lemonade!" -Hades 3DS FC: 5026-4421-7593
Black 2 FC: 0605 4087 9952 My Backloggery
My Colors! 3D Gallery

AuthorMessage
Avatar

zezhyrule

318. Posted:

Well, have fun messing around with BASIC.

I on the other hand will continue learning... Java... yeah... u__________u

Edited on by zezhyrule

[15:36] Corbs: Vita rules - 3DS drools!

zezloggery | i haz youtube | PSN ID: zezhyrule

[23:11] PhoenixCake: my brother is such a dope >___>.

AuthorMessage
Avatar

FOREST_RANGER

319. Posted:

now_youre_not wrote:

I on the other hand will continue learning... Java... yeah... u___________u

This. I'll try my hands at BASIC whenever I have enough money to get a points card.

Formely known as bobbiKat

Awesome graphing calculator

AuthorMessage
Avatar

Peidorrento

320. Posted:

Gonna try to make an side-scroller adventure now. I have to learn how to use the "DATA" command. Any suggestions?

"A vingança nunca é plena, mata a alma e a envenena" - Seu Madruga
Presidente, CEO, Programador e único empregado da Peidosoft.