DSiWare Forum

Topic: Petit Computer

Showing 581 to 600 of 9,569

AuthorMessage
Avatar

neoxid500

581. Posted:

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

neoxid500

AuthorMessage
Avatar

ramstrong

582. Posted:

Morphtroid wrote:

I won't be able to use Petit Computer for a while until I get a new stylus and screen protector :(

Keep programming for me, you all.

I'm curious of how well can people copying code from text as opposed to just scan QR code. So, this will come only as source code, no QR. Let's see how well you can copy this, and hopefully understand it. I won't be explaining anything. The source code tells all!

Major bragging rights to the first person who can change P[] array to meaningful numbers. Except for Morphtroid, who can do this in his sleep!
If you have problem, you may ask for explanation, but make sure to do your homework and show your analysis of the problem, with your potential solution.

PS: I did this in 2 hours pecking at the screen with the stylus! How far can you go? Keep pushing!

CLS:CLEAR
DIM P[16]
GOSUB @INIT
GOSUB @DISP

@LOOP
GOSUB @PANE
GOSUB @MOVE
IF G$==P$ GOTO @END
GOTO @LOOP

@END
BEEP 7:LOCATE 18,18:?"WIN!"
FOR I=1 TO 1:VSYNC 1:I=BUTTON(3):NEXT
END

@MOVE
FOR I=1 TO 1:VSYNC 1:B=BUTTON(3):I=B:NEXT
BEEP 66
IF B AND 32 THEN G$=SUBST$(G$,CY*16+CX,1,"0")
IF B AND 16 THEN G$=SUBST$(G$,CY*16+CX,1,"1")
IF B AND 1 THEN CY=CY+15
IF B AND 2 THEN CY=CY+1
IF B AND 4 THEN CX=CX+15
IF B AND 8 THEN CX=CX+1
CX=CX%16:CY=CY%16
SPOFS 1,CX*8,CY*8
RETURN

@PANE
FOR I=0 TO 15:FOR J=0 TO 15
LOCATE J,I
IF "0"==MID$(G$,I*16+J,1) THEN ?CHR$(32) ELSE ?CHR$(224)
NEXT:NEXT
RETURN

@DISP
CLS
FOR I=0 TO 255 STEP 16
H$="":C=0
FOR J=0 TO 15
IF "1"==MID$(P$,I+J,1) THEN C=C+1
IF "0"==MID$(p$,I+J,1) THEN IF C THEN H$=H$+STR$(C):C=0
NEXT
IF C THEN H$=H$+STR$(C)
LOCATE 17,I/16:?H$
NEXT

FOR I=0 TO 15
H$="":C=0
FOR J=0 TO 15
IF "1"==MID$(P$,I+(J*16),1) THEN C=C+1
IF "0"==MID$(p$,I+(J*16),1) THEN IF C THEN H$=H$+STR$(C):C=0
NEXT
IF C THEN H$=H$+STR$(C)
FOR J=0 TO LEN(H$)
LOCATE I,16+J:?MID$(H$,J,1);
NEXT
NEXT
RETURN

@INIT
P[0]=2016
P[1]=14364
P[2]=16770
P[3]=33729
P[4]=35793
P[5]=40377
P[6]=24186
P[7]=19506
P[8]=12300
P[9]=21066
P[10]=18834
P[11]=38505
P[12]=44085
P[13]=25638
P[14]=24582
P[15]=4104

FOR I=0 TO 15
V=P[I]:T$=""
FOR J=0 TO 15
T$=STR$(V%2)+T$:V=FLOOR(V/2)
NEXT
P$=P$+T$
NEXT

G$="0"*LEN(P$)

SPSET 1,156,0,0,0,0,16,16
SPANIM 1,4,15
SPSCALE 1,50
CX=0:CY=0
RETURN

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

AuthorMessage
Avatar

ramstrong

583. Posted:

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

AuthorMessage
Avatar

ramstrong

584. Posted:

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

AuthorMessage
Avatar

KAHN

585. Posted:

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

AuthorMessage
Avatar

LittleKing

586. Posted:

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

AuthorMessage
Avatar

KAHN

587. Posted:

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

AuthorMessage
Avatar

LittleKing

588. Posted:

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

AuthorMessage
Avatar

Fredje

589. Posted:

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

AuthorMessage
Avatar

KAHN

590. Posted:

oh, alright, thanks

KAHN

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

AuthorMessage
Avatar

LittleKing

591. Posted:

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

AuthorMessage
Avatar

Sprite

592. Posted:

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

AuthorMessage
Avatar

Cocobanana

593. Posted:

Its going good.

I dont know how to use MML though:/

Cocobanana

AuthorMessage
Avatar

GrabSomeEyes

594. Posted:

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

AuthorMessage
Avatar

Cocobanana

595. Posted:

I just dont understand it :/.

Lets just say i wanted to use this song:
http://www.mabinogiworld.com/showthread.php?7555-D-Super-Mari...

Its already in MML, but how would i write it to make it work on petit computer?

Cocobanana

AuthorMessage
Avatar

81Rambler

596. Posted:

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

AuthorMessage
Avatar

Morpheel

597. Posted:

@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.

Oops, no username pun.

Oh look! A Morphloggery.
Oh! eShop Gurus.

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

AuthorMessage
Avatar

81Rambler

598. Posted:

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

AuthorMessage
Avatar

triotip

599. Posted:

@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

AuthorMessage
Avatar

triotip

600. Posted:

also a link to a game with epic graphics and icy movement and somehow is 3-d ish
http://www.geocities.jp/tiny_yarou/petitcom/olion.html

triotip