DSiWare Forum

Topic: Petit Computer

Showing 621 to 640 of 9,299

AuthorMessage
Avatar

portealmario

621. Posted:

I feel sick, I have been working on a program for forever, and the emtire thing was just deleted. I was really happy with it and was going to post a QR code for it tomorrow. 😵😵😵😵

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

AuthorMessage
Avatar

Moorpheel

622. Posted:

Oh wow I'm sorry to hear that. I usually try to save my "big" programs to the SD card every now and then to have back ups if I do anything stupid.
It usually happens that I do awesome changes to a program just to Load it again when I want to Run it. I hate that.

On an unrelated note, I bought "Atari's Greatest Hits Vol. 2" for the DS some days ago, it comes with a lot of "Petit Computer-izable" game ideas I can't wait to try when my new stylus arrives... It also comes with a BASIC compiler that I can't understand at all lol, but I already have Petit Computer for that.
If any of you want good & easy game ideas, I totally recommend you to play atari games.

Edited on by Moorpheel

Moo

Oh look! A Morphloggery.
Oh! eShop Gurus.

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

AuthorMessage
Avatar

ramstrong

623. Posted:

I'm going to get on the soap box here for a while, please excuse me.

We have a good, nay, a GREAT chance to make this forum THE place to be for Petit Computer. Can you tell me where else, on the internet, can you find good Petit Computer resource, that isn't in Japanese? I can't find any. The other forums are too fragmented, and not enough contributors. This forum is alive and well, especially since we have Morphtroid God of Petit Computer here with us. We have the chance to make this place a great place for everybody.

But no one wants to wade through irrelevant posting to find their answer. It's bad enough that it took several postings for Cocobanana to post his code, which allows me to solve his problem in one post. Cocobanana still defaults to the post "It doesn't work". So does triotip. Which is false, and not at all contributing to the forum. Expect to see me say "It does work." because Petit Computer works.

No one wants to see "It doesn't work" "It works" "No, it doesn't" "Yes, it does" repeated ad infinitum, yet here it is. Why does that happen? Why do people have trouble with the most basic stuff, and instead of admitting ignorance, just blame the tool? Look, if you have problem with something, you can ask, and I will answer, but not if your whole and complete post consists of "It doesn't work".

POST YOUR CODE! But not your buggy program. Eliminate the problem, then WRITE A WHOLE NEW PROGRAM just to illustrate the problem in the simplest, easiest manner possible. No one wants to see 200 lines of buggy code, either. At the very least, be able to answer the question "At what point do you start having trouble?" Post the answer along with your question, because without it, I cannot help you. I cannot read your mind.

Please help me make this forum great. Thanks, BTW, to Nintendo Life for hosting this forum. It this forum really takes off, that's quite a bit of bandwidth we'll be using! Anyway, please keep signal to noise ratio to a high level.

To all newcomers here: Welcome! This is a friendly place where you will get help. PLEASE READ ALL THE POSTING IN THE TUTORIAL THREAD. It acts as FAQ, and that will answer most of the questions. Any other question, please use the search box. Most of your questions are already answered. You just have to find it. Then have fun! Computer programming is definitely fun. It makes you smart, and lets you have free games of your own design. Imagine that, a game made JUST FOR YOU!

Thank you for reading.

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

624. Posted:

Icebender7 wrote:

You guys are doing great :o I was wondering how to make the program ask yes or no, not by typing it in but by moving with the + pad and the A button, and then get different results depending on the answer using the GOTO command.

If you google "Petit Computer how to use buttons", you should see my blog where I did a lot of explanations on buttons and how they work. There's also a post on QR code thread on reading dpad/buttons. Look for @SETB5 subroutine.

But if I read you right, I suggest that you abandon the dpad idea and just use A for OK, and B for CANCEL. It's cleaner and easier that way.

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

625. Posted:

portealmario wrote:

I feel sick, I have been working on a program for forever, and the emtire thing was just deleted. I was really happy with it and was going to post a QR code for it tomorrow. 😵😵😵😵

Ouch! That must really hurt! I wish I can say "I know how you feel", but I don't. When my program gets accidentally deleted, it usually occurs in the middle, not the day before posting! And if I can have my way, that'll never happen again. I'm triple back up now. And all my stuff gets uploaded to the blog at earliest opportunity.

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

626. Posted:

I do have a question to the group. Shall we start a new thread to act as Source Code repository? I like source codes. I think it gives people a chance to get familiar with the language effortlessly. I began by copying code into the computer. But so far, I'm the only one? Is there anybody beside me who wants to share code? Because if so, let's create that repository. Otherwise, I'm content with collecting them on my blog.

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

Moorpheel

627. Posted:

Well, you are free of creating any threads you want as long as they have a purpose that requires another thread.
I could see source codes fitting in the tutorials thread, but it could get messy.

I say go for it. If TBD decides not to lock it, it means it's good.

Maybe we could ask for a Petit Computer subforum to be created :D (jk, I highly doubt that would happen).

BTW, you should try editing your comments to merge them together, multiple posting is usually not cool.

Edited on by Moorpheel

Moo

Oh look! A Morphloggery.
Oh! eShop Gurus.

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

AuthorMessage
Avatar

ramstrong

628. Posted:

Morphtroid wrote:

BTW, you should try editing your comments to merge them together, multiple posting is usually not cool.

I only do that if I post on a single subject. Multiple subjects gets multiple posting. I'm not about to combine Sprite's post with PortealMario's. And the source code forum post is supposed to be on soap box post, but my addled brain somehow missed it. Gah! Sorry!

Edit:
I don't think a Petit Computer subforum is unreasonable, but I'm not sure it's a good idea. Judging from my experience with Small Basic, whole separate forum will cause many threads, and so fracture the community, where as a few dedicated threads will cause the whole community to join in and have lots of activities. So, I think 3-4 threads is better than a whole subforum. I just want to know whether or not other people will contribute their source code before starting a dedicated thread on it.

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

Icebender7

629. Posted:

ramstrong wrote:

Icebender7 wrote:

You guys are doing great :o I was wondering how to make the program ask yes or no, not by typing it in but by moving with the + pad and the A button, and then get different results depending on the answer using the GOTO command.

If you google "Petit Computer how to use buttons", you should see my blog where I did a lot of explanations on buttons and how they work. There's also a post on QR code thread on reading dpad/buttons. Look for @SETB5 subroutine.

But if I read you right, I suggest that you abandon the dpad idea and just use A for OK, and B for CANCEL. It's cleaner and easier that way.

thx I'll use A for yes and B for no, until I get better

Edited on by Icebender7

Icebender7

AuthorMessage
Avatar

portealmario

630. Posted:

So, I guess I will start a new project. Maybe there is an early version on the sd card. @ramstrong I am definately going to use that website, I have been trying to fiqure button use out for a long time, but when I see other people using it, it is too unfamilliar to recognize.

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

AuthorMessage
Avatar

portealmario

631. Posted:

@ramstrong I totally agree with your soapbox post
I think that someone should try to make a clone of minicraft for petit computer(I haven't learned enough to start myself). It is a game made by notch in 24 hours(with some similarities to minecraft) I'm sure someone(cough) @morphtroid (cough) could do it. It would be really cool to play it on the ds, and it would be easy to mod due to it's BASIC language. Do you think anyone would want to do it?

Edited on by portealmario

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

AuthorMessage
Avatar

Sprite

632. Posted:

Portealmario i feel so bad for you. I know what its like to lose all of your data. Mine was in a different circemstance so yours must feel 100 times worse. Hope ypu find a backup :)
EDIT: Hope you find a backup

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

portealmario

633. Posted:

Thanks @Sprite!

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

AuthorMessage
Avatar

81Rambler

634. Posted:

Morphtroid wrote:

On an unrelated note, I bought "Atari's Greatest Hits Vol. 2" for the DS some days ago, it comes with a lot of "Petit Computer-izable" game ideas I can't wait to try when my new stylus arrives... It also comes with a BASIC compiler that I can't understand at all lol, but I already have Petit Computer for that.
If any of you want good & easy game ideas, I totally recommend you to play atari games.

I acctually picked that up for those reasons, that it included the Atari 400 emulator as well as... Atari Basic Programming (12 lines with a comically named 'Keyboard controller'), but back to the Atari 400 I was a bit curious how easy/difficult it would be to translate Basic code for the Vic20/Coimmodore64 to it as uses a similar peek/poke system (although some minor language changes would be made of course).

These sorts of collections are great places for inspiration though. My current project is currently inspired from Activision Anthology, which I should have some conceptual stuff up soon. Professor Layton was a pretty obvious inspiration for my first (as well as The 7th Guest), and some collections I could recommend to others are Atari Anthology and Intelivsion Lives.

Failing those Morphtroid I WILL be expecting a Petit Computer version of Atari Basic Programming ;p (joking, of course)

Edited on by 81Rambler

81Rambler

AuthorMessage
Avatar

Tingle

635. Posted:

So, I have another question. It's about the DIM command, and arrays. I just don't understand what they do. As in, the Petit Computer help automatically assumes I understand the word array. Would somebody oblige and explain to me the concept of an array and what it can be used for?

Tingle

AuthorMessage
Avatar

Moorpheel

636. Posted:

@Rambler: I managed to do a little program with Atari Basic, but the terminal emulator really lacks some basic functions, like DPad support. To move around your code you need press a button combination every time you want to move a single space so it gets tiresome and boring, Petit Computer is clearly the superior choice. That doesn't means it's not fun to play around with though. It's fascinating in it's own historical kind of way. There are also tons of premade codes you can find online.

The 2600 BASIC game is pretty bad though... I may need to read the 27-pages instruction book again if I want to get anything from that one.

@Tingle:

Wikipedia wrote:

In computer science, an array data structure or simply an array is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula.[1][2][3]
For example, an array of 10 integer variables, with indices 0 through 9, may be stored as 10 words at memory addresses 2000, 2004, 2008, … 2036, so that the element with index i has the address 2000 + 4 × i.[4]
Arrays are analogous to the mathematical concepts of vectors, matrices, and tensors. Indeed, arrays with one or two indices are often called vectors or matrices, respectively. Arrays are often used to implement tables, especially lookup tables; the word table is sometimes used as a synonym of array.
Arrays are among the oldest and most important data structures, and are used by almost every program. They are also used to implement many other data structures, such as lists and strings. They effectively exploit the addressing logic of computers. In most modern computers and many external storage devices, the memory is a one-dimensional array of words, whose indices are their addresses. Processors, especially vector processors, are often optimized for array operations.
Arrays are useful mostly because the element indices can be computed at run time. Among other things, this feature allows a single iterative statement to process arbitrarily many elements of an array. For that reason, the elements of an array data structure are required to have the same size and should use the same data representation. The set of valid index tuples and the addresses of the elements (and hence the element addressing formula) are usually,[3][5] but not always,[2] fixed while the array is in use.
The term array is often used to mean array data type, a kind of data type provided by most high-level programming languages that consists of a collection of values or variables that can be selected by one or more indices computed at run-time. Array types are often implemented by array structures; however, in some languages they may be implemented by hash tables, linked lists, search trees, or other data structures.
The term is also used, especially in the description of algorithms, to mean associative array or "abstract array", a theoretical computer science model (an abstract data type or ADT) intended to capture the essential properties of arrays.

Moo

Oh look! A Morphloggery.
Oh! eShop Gurus.

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

AuthorMessage
Avatar

ramstrong

637. Posted:

@Morphtroid
Gee, I think you should link the article, instead of copy and paste.

@Tingle
This is part of "variable" concept. Also Indirection. :http://en.wikipedia.org/wiki/Indirection

The computer is just a bunch of numbers. A variable will occupy one of those numbers (or memory address). So, when you do something like A=10, that means somewhere in memory, say address#4532, it will have a value of 10. Also somewhere else, there will be an entry "&A=4532" <- this here is a pointer (indirection).

An array is simply a bunch of variables together. An example would be a row of ducks, Solar panel arrays, string is an array of characters, etc. A lot of times, we want a group of variables to denote the same thing, with several different elements. Taking an example of ducks, we can say, "Shoot the 3rd duck from the left" which something like DUCK[2]=TRUE. 3 is the reference number. If we take memory address of DUCK is #3231, then
&DUCK[0]=3231
&DUCK[1]=3232
&DUCK[2]=3233
&DUCK[3]=3234
&DUCK[4]=3235
and so on...

DUCK[2] because array starts from zero.

However, the computer will need to know how many DUCK variables are there, because, eventually, you want to put another variables after it. So, we use DIM, as in DIM DUCK[5], which means "Let there be 5 DUCK variables going from 0 to 4". BASIC takes care of the internal memory allocations so you don't have to worry about it. But you do need to declare how many elements an array have before it can be used. This is also why you can't resize the DIM because you'll be in danger of overwriting other variables. So, you CLEAR the memory first, before allocating variables using DIM.

The nice thing about it is that we can use a variable as reference. That means we can do this:
FOR I=0 TO 4
DUCK[I]=TRUE
NEXT
In this case, variable I is changed with in the loop, so DUCK[0],DUCK[1]...DUCK[4] are all set to TRUE.
We can also do this:
INPUT "CHOICE",N
CHOICE[N]=TRUE

Why variable "I"? It's tradition, same as we use the term "Debug" when we mean correcting errors. "Debug" means getting rid of bugs, in this case a moth. The variable I is used as convention because in FORTRAN, variable I to N defaults to integer, and we use integers (as opposed to real) in loops.

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

portealmario

638. Posted:

@ramstrong Brilliant explanation!

Edited on by portealmario

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

AuthorMessage
Avatar

ramstrong

639. Posted:

Example of using Sprite Collision. Note that SPHITNO is set by the system automatically.

ACLS:CLEAR
MAXSP=19
SPSET 0,96,0,0,0,0
SPHOME 0,8,8
FOR I=1 TO MAXSP
SPSET I,64,0,0,0,0
SPHOME I,8,8
SPOFS I,255+RND(245)+5,RND(180)+5
NEXT

@LOOP
VSYNC 1
SPOFS 0,TCHX,TCHY

FOR SPNUM=1 TO MAXSP
IF SPCHK(SPNUM)==0 THEN GOSUB @MOVE
NEXT

IF SPHIT(0) THEN GOSUB @FLING
GOTO @LOOP

@FLING
BEEP 61
SPREAD(SPHITNO),X,Y
SPCHR SPHITNO,92
SPOFS SPHITNO,X+RND(225),Y+RND(95)-40,40
RETURN

@MOVE
SPREAD(SPNUM),X,Y
TX=TCHX:TY=TCHY
DX=TX-X:DY=TY-Y
DR=SQR(DX*DX-DY*DY)
SPOFS SPNUM,TX,TY,DR
SPCHR SPNUM,72
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

LittleKing

640. Posted:

Just wondering, but does anyone here have any background in software development, or experience with programming other than BASIC?

LittleKing