Forums

Topic: Petit Computer

Posts 581 to 600 of 9,620

ramstrong

portealmario wrote:

Is there a command that stops the computer from going through coding and waits for the user to press any key to continue(like the "sleep" command in other BASIC languages)?

FOR I=1 TO 1:VSYNC 1:I=BUTTON(3):NEXT

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

ramstrong

triotip wrote:

okay let me reform my question because your answer didn't fix my problem.
i have a sprite in the middle of the screen that represents your character and another sprite that represents the store.
i want the store to open when your sprite hits the store sprite.

Sample 9, option 2 has SPCOL/SPHIT function you're looking for.

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

KAHN

whenever i look at other people's code, i always see something like:
I=0 TO 99
or something like that. what's it for?

KAHN

3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12

LittleKing

0LD_SK0OL_PUNK wrote:

whenever i look at other people's code, i always see something like:
I=0 TO 99
or something like that. what's it for?

I don't use BASIC, but it's used in for loops. When you say "For I=0 TO 99" it's like saying "do this 100 times."
It's kind of like this for loop, which sets a variable i to 0, then performs code as long as i <= 99 while incrementing i by one every loop iteration:

for(int i = 0; i <= 99; ++i){
statements
}

EDIT: Also saw that you were making a calculator, but didn't add exponents. If you want to add exponents manually, it's best to only do positive integer exponents, and treat it as repeated multiplication. Let's say we have b for base, e for exponent and r for result. The base and exponent are determined based on the input, while result (r) should default to 1. Then, construct a for loop which iterates e times, multiplying r by b each time. After the for loop, r contains b^e. Of course, I think Petit Computer has a function POW(base, exponent) which makes exponents really simple if you don't want to do it manually...

Edited on by LittleKing

LittleKing

KAHN

Metabble_King wrote:

0LD_SK0OL_PUNK wrote:

whenever i look at other people's code, i always see something like:
I=0 TO 99
or something like that. what's it for?

I don't use BASIC, but it's used in for loops. When you say "For I=0 TO 99" it's like saying "do this 100 times."
It's kind of like this for loop, which sets a variable i to 0, then performs code as long as i <= 99 while incrementing i by one every loop iteration:

for(int i = 0; i <= 99; ++i){
statements
}

alright, but why does everybody use I as their variable instead of another letter?

KAHN

3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12

LittleKing

0LD_SK0OL_PUNK wrote:

Metabble_King wrote:

0LD_SK0OL_PUNK wrote:

whenever i look at other people's code, i always see something like:
I=0 TO 99
or something like that. what's it for?

I don't use BASIC, but it's used in for loops. When you say "For I=0 TO 99" it's like saying "do this 100 times."
It's kind of like this for loop, which sets a variable i to 0, then performs code as long as i <= 99 while incrementing i by one every loop iteration:

for(int i = 0; i <= 99; ++i){
statements
}

alright, but why does everybody use I as their variable instead of another letter?

You don't need to use I, any symbol should do. We often use J for nested loops. I don't know exactly why people use I, but I always think of it as the Index when I'm iterating over an array. Or it's the number of previous Iterations.

LittleKing

Fredje

0LD_SK0OL_PUNK wrote:

Metabble_King wrote:

0LD_SK0OL_PUNK wrote:

whenever i look at other people's code, i always see something like:
I=0 TO 99
or something like that. what's it for?

I don't use BASIC, but it's used in for loops. When you say "For I=0 TO 99" it's like saying "do this 100 times."
It's kind of like this for loop, which sets a variable i to 0, then performs code as long as i <= 99 while incrementing i by one every loop iteration:

for(int i = 0; i <= 99; ++i){
statements
}

alright, but why does everybody use I as their variable instead of another letter?

That i variable stands for iteration and it's a commonly used name for the counter variable of a for loop

Fredje

KAHN

oh, alright, thanks

KAHN

3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12

LittleKing

Fredje wrote:

0LD_SK0OL_PUNK wrote:

Metabble_King wrote:

0LD_SK0OL_PUNK wrote:

whenever i look at other people's code, i always see something like:
I=0 TO 99
or something like that. what's it for?

I don't use BASIC, but it's used in for loops. When you say "For I=0 TO 99" it's like saying "do this 100 times."
It's kind of like this for loop, which sets a variable i to 0, then performs code as long as i <= 99 while incrementing i by one every loop iteration:

for(int i = 0; i <= 99; ++i){
statements
}

alright, but why does everybody use I as their variable instead of another letter?

That i variable stands for iteration and it's a commonly used name for the counter variable of a for loop

Thanks. No one ever told me explicitly. I've always used I and thought of it as just the number of previous iterations.

Also, if you like programming, you might want to check out Stanfords videos online on their YouTube channel or iTunes U. I've been following the lectures online and constructed the assignment calculator for cs193p (uses Reverse Polish Notation, can display results as a scale-able, pan-able graph, etc) and it's pretty good. They have a lower level course on Java IIRC as well, which is a nice starting point.

LittleKing

Sprite

Cocobanana how's pokemon TCG comin

Edited on by Sprite

I'm not saying let's kill all the stupid people, I'm just saying let's take off the warning labels, and see what happens.
Friend Code: 1075-1228-4183

Cocobanana

Its going good.

I dont know how to use MML though:/

Cocobanana

GrabSomeEyes

Cocobanana wrote:

Its going good.

I dont know how to use MML though:/

cough cough http://www.gamefaqs.com/boards/663843-petit-computer/63524945 cough
AH http://www.gamefaqs.com/boards/663843-petit-computer/63484250 CHOO!
Well then! Excuse me.

Edit:

neoxid500 wrote:

http://d.hatena.ne.jp/eidaht/20120630/1341016869

This was originally on the QR Code sharing thread but people are being CATZ... and keep asking about MMLS. Use this program to make 'em much easier and implement them in your games.

NOW STOP ASKING XD

While I love that program, it doesn't have nearly as many sounds as you get with just regular programming. I just use it to mess around with like Mario Paint. Any actual music making I'd recommend learning how to create in the editor. Plus, the satisfaction of hearing something you worked hard for.

Edited on by GrabSomeEyes

Eos OS: http://conlogxl.forumotion.com/t12-eos-os-v10
3DS FC: 3695-0514-5044

81Rambler

Took an extended break from coding, but I'm going to restart some of my older projects. I had mentioned before that I was attempting to make some Game&Watch style games, but drawing a screen full of IF statements proved to be a bit much for the system and rendered it sluggish before I even finished all the call points for it.

I've started experimenting with sprites a bit (well specifically the background tiles thus far) but is it possible to access the ascii character set for usage in sprites and background tiles? How would I go about doing it?

81Rambler

Eel

@81Rambler: I remember that! I wrote you a suggestion:

Morphtroid wrote:

If you want to make Game and Watch games. I just thought this up:
You could use GRP background with certain higlighted areas (think: Game and Watch character's "shadows") and use GPAINT to make them black or a color similar to the background depending on what should be on screen.

I may need to try it myself now.

You wouldn't need to use sprites, just a G-drawn background and gpaint.
I'd do an example myself, but I won't be able to use Petit Computer for a few days.

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok | Nintendo Network ID: Abgarok

81Rambler

Morphtroid wrote:

@81Rambler: I remember that! I wrote you a suggestion:

Morphtroid wrote:

If you want to make Game and Watch games. I just thought this up:
You could use GRP background with certain higlighted areas (think: Game and Watch character's "shadows") and use GPAINT to make them black or a color similar to the background depending on what should be on screen.

I may need to try it myself now.

You wouldn't need to use sprites, just a G-drawn background and gpaint.
I'd do an example myself, but I won't be able to use Petit Computer for a few days.

Well the conflict with that is that I was considering using the background for the static background art (very simple in design, mostly a brick wall), and I'm not sure weither attempting to paste the ascii art on top of it would cause the art to be covered in full 8x8 blocks or just the pixels used for the characters themselves...

Unless I'm completely misunderstanding what you're saying which may be a possibility x_x. I'll be futzing around with it for the next few days and I'll keep in mind what you said

81Rambler

triotip

@ramstrong
i have used spcol & sphit but they aren't working
do you know how to make icy movement? (were it slowly increases then once you let go slowly decrases to a stop(by it i mean the speed))

triotip

portealmario

Can anybody help me with seprate files, and getting programs to reference them? I tried looking at the "save" and "load" commands, but it says nothing. I want a program to save data from previous sessions abd use it in future sessions.

meng 😐
3ds friend code:1762-2769-7142

Please login or sign up to reply to this topic