DSiWare Forum

Topic: Petit Computer

Showing 2,741 to 2,760 of 9,492

AuthorMessage
Avatar

Bluerobin2

2,741. Posted:

@ramstrong, I do not understand. Those were 2 separate questions. I need to read the color of characters so I could use it to draw a separate grp which I need to save. I suppose I could save it to a MEM file (Which I could).. But I still do not get how you would read the color of a character at a certain position. In my case, The characters are squares. About my drawing program, I made it on a weeked, so I had it up when I read this. I decided to make it better though.
@MrSirr you might also want to look into a game called light cycle on the petit computer wiki. The game fits your definition perfectly.

Everybody do a chirp. CHIRP.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

ramstrong

2,742. Posted:

Bluerobin2 wrote:

@ramstrong, I do not understand. Those were 2 separate questions. I need to read the color of characters so I could use it to draw a separate grp which I need to save. I suppose I could save it to a MEM file (Which I could).. But I still do not get how you would read the color of a character at a certain position. In my case, The characters are squares. About my drawing program, I made it on a weeked, so I had it up when I read this. I decided to make it better though.

The characters, you mean text screen, right? It defaults on palette colors. You cannot set it up separately. Whatever palette color on color 15(or 14) is the color of the text. If you want graphics, then GSPOIT will read the color.

You don't need to use MEM$. You can load/save frame buffers individually without having them displayed. But it's up to you.

Post your drawing program, then. I already have visions of better Animator version, with colors! I suppose it'll be like Flipnote->Flipmemo improvement. First one is simple black and white. Second one with colors!

@Randomouscrap98

Thanks! FYI, QR code size isn't fixed because the amount of error correction coding involved. The more error correction used, the more forgiving in capture. Apparently PTCUtilities uses least amount of error correction.

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

randomous

2,743. Posted:

@ramstrong Errr but they're all the same size, right? That's all that matters in my program: it doesn't care what size the QR images are, as long as they're all the same size as each other. They don't even need to be square lol. Someone has already used my program to stitch together PTCUtilities QR codes, so I know it works. Oh, and your flipnote program is really cool! It'd be really awesome if GRP files could be loaded faster, but there's nothing we can do about it. Oh well, it's still really neat!

Edit: Thanks for using my QR Stitcher!

Edited on by randomous

randomous

AuthorMessage
Avatar

ramstrong

2,744. Posted:

randomouscrap98 wrote:

@ramstrong Errr but they're all the same size, right? That's all that matters in my program: it doesn't care what size the QR images are, as long as they're all the same size as each other. They don't even need to be square lol. Someone has already used my program to stitch together PTCUtilities QR codes, so I know it works. Oh, and your flipnote program is really cool! It'd be really awesome if GRP files could be loaded faster, but there's nothing we can do about it. Oh well, it's still really neat!

Oh, I was talking about the difference in QR number, not resolution. So, PTC Util may output 4 QR, but PT Edit may end up with 5, with the same code. Speaking of resolution, can you preview the image resolution size before I press the Stitch button? It will help me make a decision as to how many QR code I want to fit in a row. Brilliant program, BTW. The stitched image is up in the directory, now. Thank you for writing this program.

Have you removed the built-in delay that I put into the program? I thought of putting in a variable so it's easily modified at the top. Oh well. If enough people want it, I guess I can update.

in the @ANIM sub there is a line that says
FOR J=0 TO 10:VSYNC 1: IF BTRIG ...
NEXT J
GOTO @ANIM2

Change that to FOR J=0 TO 0:VSYNC 1: IF BTRIG ...
And that's as fast as it goes.

I'm curious as to how many saved images can Petit Computer hold, because if it is possible, I'd like to put in 48 images for the next Animator program!

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

randomous

2,745. Posted:

@ramstrong The program isn't able to tell the size of the images until it begins stitching, so I suppose I could preread all the images as soon as the user selects a directory, but then the program may hang on slower computers. That's a good idea though, so I'll see what I can do about adding it. And I didn't know you were talking about the number of images, I'm sorry! I know PTCUtilities generates less images, but I still like using the smileboom one (IDK why). I think at some point someone said that Petit Computer has 10mb reserved for files, so if each GRP is only 50k, you can probably (maybe) save around 200 of them.

randomous

AuthorMessage
Avatar

ramstrong

2,746. Posted:

randomouscrap98 wrote:

@ramstrong The program isn't able to tell the size of the images until it begins stitching, so I suppose I could preread all the images as soon as the user selects a directory, but then the program may hang on slower computers. That's a good idea though, so I'll see what I can do about adding it. And I didn't know you were talking about the number of images, I'm sorry! I know PTCUtilities generates less images, but I still like using the smileboom one (IDK why). I think at some point someone said that Petit Computer has 10mb reserved for files, so if each GRP is only 50k, you can probably (maybe) save around 200 of them.

No need to be sorry. It's a common mistake. Oh, you can just provide a size preview button. I don't have to have the size preview automatically on, if that helps. So, you just do the stitching, but not save the image. You can even have it as an in-between steps after pushing stitch button and saving images, saying, "The image will be 400x700. OK? Cancel?" for example. Thanks again for a great program. You're a life saver!

EDIT: Come to think of it, I think a dialog box OK/CANCEL before saving would be ideal. I hope that's not too difficult to implement.

Edited on by ramstrong

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

MrSirr

2,747. Posted:

I'm making a poker game and trying to make the cards is easy. The suits? HARD. Here's the coding, what did I do wrong with the suits?

http://img195.imageshack.us/img195/6375/qr0.png

MrSirr

AuthorMessage
Avatar

Discostew

2,748. Posted:

randomouscrap98 wrote:

TLDR; Don't do this:

FOR I=0 TO 100
IF <WHATEVER> THEN <DO SOMETHING>:GOTO @ENDLOOP
NEXT
@ENDLOOP

Note: This is perfectly acceptable (if not a little messy) in pretty much all languages that are compiled to machine code (and support unconditional jumps to a fixed location), because the machine's not going to care about what loop you're in.

I made an entire argument, assuming you said "Do this" when you actually said "Don't do this", so, it has been deleted, lol.

But anyways, a way around this can be done like so...

FOR I=0 TO 100
IF <WHATEVER> THEN <DO SOMETHING>:I=100:GOTO @ENDLOOP
@ENDLOOP
NEXT

Basically, I throw the @ENDLOOP label into the block, and when the comparison is true, it does what it needs to, then forces the iterating variable to the max of the FOR/NEXT loop, and then goes to the label. This will allow it to complete the loop, iterating the variable by one more, and examine the variable if it needs to loop again (which it won't), so it skip all code until it reaches the corresponding NEXT statement and go past it.

Unless I'm mistaken, you can't put a NEXT statement in the IF line to get it to jump out of the block (and remove the label and maxing the iterating assignment) because I think when it does exit the FOR/NEXT block, PTC scans for the next NEXT statement, no matter where it is (even in an IF statement), so if it find one in an IF statement, it will proceed right after that statement, resulting in staying in the block and reaching the true NEXT statement, resulting in a "NEXT before FOR" error. I can't check it right now, but I believe this is what will happen in that scenario.

Edited on by Discostew

"What fun is there in making sense?"
Lazer Light Studios - Home of the MM2 PTC project

Pokemon 3DS Friend Safari - Ice - Spheal, Sneasel, Lapras

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

AuthorMessage
Avatar

ramstrong

2,749. Posted:

Discostew wrote:

Unless I'm mistaken, you can't put a NEXT statement in the IF line to get it to jump out of the block (and remove the label and maxing the iterating assignment) because I think when it does exit the FOR/NEXT block, PTC scans for the next NEXT statement, no matter where it is (even in an IF statement), and then will proceed right after that statement, resulting in staying in the block and reaching the true NEXT statement, resulting in a "NEXT before FOR" error. I can't check it right now, but I believe this is what will happen in that scenario.

I did loops experimentation on Petit Computer Journal#9

Yes, it will happen as you say, but simply append GOTO statement after NEXT, and you're good to go!

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

randomous

2,750. Posted:

Hi @Discostew. I was just about to point out that I said "Don't do this" when I thought to myself, "You know, I should refresh the page," and then your post was magically different only 3 seconds after you wrote it lol. OK, that was a hyperbole, it was really 3 minutes. Anyway, I believe you're right; I've never been able to use NEXT more than once in a FOR loop (for instance, in a condition). Instead, I just increment the loop counter. But yeah, you're absolutely right: your way is the right way to do this in Petit Computer. In my application, I was only exiting to save some computations, but it's only like 400 per second. In this case, I decided to just let the for loop go through all its iterations instead.

randomous

AuthorMessage
Avatar

ramstrong

2,751. Posted:

randomouscrap98 wrote:

Hi @Discostew. I was just about to point out that I said "Don't do this" when I thought to myself, "You know, I should refresh the page," and then your post was magically different only 3 seconds after you wrote it lol. OK, that was a hyperbole, it was really 3 minutes. Anyway, I believe you're right; I've never been able to use NEXT more than once in a FOR loop (for instance, in a condition). Instead, I just increment the loop counter. But yeah, you're absolutely right: your way is the right way to do this in Petit Computer. In my application, I was only exiting to save some computations, but it's only like 400 per second. In this case, I decided to just let the for loop go through all its iterations instead.

Oh, you mean something like this? ;)

A$="HELLO SAILOR!"
FOR I=0 TO LEN(A$)-1
IF INSTR("AEIOU",MID$(A$,I,1))>=0 THEN NEXT
? MID$(A$,I,1);
NEXT
?:?"DONE!"

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

Bluerobin2

2,752. Posted:

Ok, I see where you are going @ramstrong. Thanks! One more question: Could someone give me an example of GCOPY copying the console screen then saving it as a GRP? Code speaks better than explanation. Thanks!

Everybody do a chirp. CHIRP.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

ramstrong

2,753. Posted:

Bluerobin2 wrote:

Ok, I see where you are going @ramstrong. Thanks! One more question: Could someone give me an example of GCOPY copying the console screen then saving it as a GRP? Code speaks better than explanation. Thanks!

?? GCOPY does not copy console screen. Maybe you're thinking reading the console character-by-character, then GPSET it on GRP?

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

Bluerobin2

2,754. Posted:

@ramstrong yes, but I want to copy the color of the character, Not the character itself. In my case, the characters are all squares but different colors.

Everybody do a chirp. CHIRP.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

MrSirr

2,755. Posted:

I'm making a poker game and trying to make the cards is easy. The suits? HARD. Here's the coding, what did I do wrong with the suits?

http://img195.imageshack.us/img195/6375/qr0.png

MrSirr

AuthorMessage
Avatar

ramstrong

2,756. Posted:

Bluerobin2 wrote:

@ramstrong yes, but I want to copy the color of the character, Not the character itself. In my case, the characters are all squares but different colors.

OK, sorry. I misunderstood. You could've show some code to explain it. I assume this is what you mean:
‘COLOR TEST
@INIT
CLS
LL=5:HL=12
@DRAWLOOP
X=FLOOR(TCHX/8):Y=FLOOR(TCHY/8)
IF TCHST==FALSE GOTO @DRAWLOOP
FOR IX=0 TO 31
FOR IY=0 TO 22
D=SQR(ABS((IX-X)(IX-X))+ABS((IY-Y)(IY-Y)))
C=65
IF D>LL AND D<HL THEN C=65+D
COLOR C-63
LOCATE IX,IY:?CHR$(C);
NEXT IY:NEXT IX
VSYNC 1:IF BTRIG() GOTO @SAVE
GOTO @DRAWLOOP

@SAVE
?”DONE”
END

And your question is what to put in @SAVE subroutine so that you can save the color info, instead of the character info. Is that right?
Well, I have no answer for you. Sorry. There are 2 workarounds off the top of my head:(1) maintain an array holding the color info as you draw them. (2) Use BG screen, assuming one is available.

EDIT
Not off top of my head, but just use GFILL to draw it. You're working on Pixel Art, I assume?

Edited on by ramstrong

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

shinydragonmist

2,757. Posted:

so far i have made a text program that beeps and endlessly repeat itself. and i also but 2 programs i found on here together they were pong and also the pokemon bike mml
all i have to do is start pong pause it and unpause it and the music will play i know that it is just basicnoop stuff but that is as far as i have gotten gotten so far i am going to try to get better at it and make my own program that is good enough for me to post. hope it will be soon but it probably wont so far my idea is for it to be a text adventure. thanks for all the programs you have posted and made

3ds friend code ; 0774-4507-6022
pokemon white 2 friend code: 1078-1500-5443

AuthorMessage
Avatar

ramstrong

2,758. Posted:

MrSirr wrote:

I'm making a poker game and trying to make the cards is easy. The suits? HARD. Here's the coding, what did I do wrong with the suits?

http://img195.imageshack.us/img195/6375/qr0.png

V$="123456789TJQKA"
S$="HDSC"
@LOOP
C=RND(14*4)
VSYNC 1
V=FLOOR(C/4):S=FLOOR(C%4)
?MID$(V$,V,1);MID$(S$,S,1);" "
GOTO @LOOP

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

MrSirr

2,759. Posted:

ramstrong wrote:

MrSirr wrote:

I'm making a poker game and trying to make the cards is easy. The suits? HARD. Here's the coding, what did I do wrong with the suits?

http://img195.imageshack.us/img195/6375/qr0.png

V$="123456789TJQKA"
S$="HDSC"
@LOOP
C=RND(14*4)
VSYNC 1
V=FLOOR(C/4):S=FLOOR(C%4)
?MID$(V$,V,1);MID$(S$,S,1);" "
GOTO @LOOP

Thanks, thats really good, but I just got on here to say nvm, cuz i figured it out. But thx anyway! u seem to be good at basic. Im kindof a beginner. lol

MrSirr

AuthorMessage
Avatar

Bluerobin2

2,760. Posted:

@ramstrong One is available. I assume I could use the BG screen. Then what?
I appreciate all of your help. Thank you.

Everybody do a chirp. CHIRP.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

3DS Friend Code: 3007-9228-5126