Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JWinslow23

Pages: 1 ... 31 32 [33] 34 35 ... 40
481
TI Z80 / Re: Snow Demo
« on: January 26, 2014, 01:55:51 pm »
So am I.

Here's what I got.

rand
0
50
100
Josiah
201
201
191
Xeda
477
334
353

I dunno, it's really at the mercy of the generator. And how many times you use it.

482
TI Z80 / Re: Snow Demo
« on: January 26, 2014, 01:47:44 pm »
int(2rand has a .5 probability of being 1 or 0, right? So yeah.

483
TI Z80 / Re: Snow Demo
« on: January 26, 2014, 01:40:55 pm »
OK, it's settled.

Xeda and I are going to have a competition.

The rules:
We must modify our codes to be almost similar, except for mine using lists and hers using matrices. (i.e. either I generate my snowflakes one after another, or she generates hers at random times)
We must each test 3 values of rand: 0, 10, and 100.
We shall make another program in this format and run it:
Code: [Select]
startTmr -> Z
prgmOURSNOW
Disp checkTmr(Z
Whoever has a lower value for most of them is the winner.

484
TI Z80 / Re: Snow Demo
« on: January 26, 2014, 01:12:41 pm »
And they are. :P

Really, the demo "fills" a top spot every iteration. Then, on the next iteration, it falls down.

If you wanna know how to fix it, I know.

485
TI Z80 / Re: Snow Demo
« on: January 26, 2014, 12:57:32 pm »
Really? Cause it has. :P

Try setting 100 as rand before starting the program. You'll see what I mean.


486
TI Z80 / Re: Snow Demo
« on: January 26, 2014, 12:48:45 pm »
Let me explain it to you in the least complicated way I can...

The RNG makes a snowflake in two unfilled positions at the top.
Near the end, these positions become filled.
When there is only one unfilled position, it finds that position, makes a snowflake there, then checks for another unfilled position.
The problem is, there is no unfilled position.
So it keeps generating forever.

487
TI Z80 / Re: Snow Demo
« on: January 26, 2014, 12:34:10 pm »
Works, except for one thing...

When there is only one opening in the top spot, it freezes. I recommend you just generate a snowflake position, and if a snowflake isn't there already, then and only then can you add it as a snowflake.

488
TI Z80 / Re: Snow Demo
« on: January 26, 2014, 12:19:59 pm »
Sometimes, with your version, snowflakes appear to merge with other snowflakes. And it usually ends before the entire screen is filled. Just saying.

489
TI Z80 / Re: Snow Demo
« on: January 26, 2014, 11:13:42 am »
Mine draws the flakes when they are newly added at the top of the screen, then it searches the matrix for snowflakes that can move down. It erases those ones and draws their new position.

Also, DJ_O, you didn't need the "1=" part of those If statements.
* Xeda112358 runs

The way I test for flakes that can move is I store the matrix rotated so that column 1 is the first row of snow flakes. Then each snow flake is represented by the column number it is in (so if it is homescreen column 6, it has a 6 in the matrix). My code is then:
Code: [Select]
Matr>list([A],8,L2 ;get the last row
For(A,7,1,-1
Matr>list([A],A,L1
L1*(L1 and not(L2→L3 ;This checks if anything in L1 can move down into L2
;"not(L2" leaves a 0 where there is already a flake, else 1 if empty
;Then "L1 and not(L2" leaves a 1 if there is a snowflake above an empty space
L1-Ans→L1 ;remove the snowflakes that can move down from L1
While max(L3
max(L3→B ;location of the snowflake furthest to the right
0→L3(Ans ;remove the snowflake from L3, the list of moveable flakes
0→[A](B,A ;remove it from the matrix
Output(A,B," ;Erase it
min(16,max(1,B+1-2int(2rand ;randomly move left/right
If L2(Ans ;check if the space is occupied
B
Ans→[A](Ans,A+1 ;write the snowflake to the new coordinate
Output(A+1,Ans,"*
End
L1→L2 ;now This row becomes the new lower row
End

Can you give me the full code?

490
TI Z80 / Re: Snow Demo
« on: January 25, 2014, 09:17:53 pm »
What I do, in pseudocode:

:If a snowflake can move down,
:Then
::Erase the snowflake there.
::Change the snowflake coordinates to that spot.
::Calculate random direction between left, right, or staying put.
::If the snowflake can move there,
:::Change the snowflake coordinates to that spot.
::Draw the snowflake where it belongs.
:End

491
TI Z80 / Re: Snow Demo
« on: January 25, 2014, 08:59:17 pm »
Hmm, you could use a matrix (it uses indices the same as pixel coords or homescreen coordinates, so "Y" then "X").

This way, the program doesn't start to slow down as more snow flakes are added. Basically, just create an 8*16 matrix (it will be huge, being the size of a 128 element list). Then you can just check if a snow flake is already in a spot as if you were reading homescreen coordinates:
Code: [Select]
[A](Y,X

This might speed things up a bit (not sure).

You're right! Now, it will only take 128 iterations of a For( loop (plus a little bit extra time) to move and display the snowflakes, not to mention to extra size of a matrix! :P

Besides, I think it's pretty fast already.

492
Humour and Jokes / Re: 9001 signs you're addicted to calcs and Omni
« on: January 25, 2014, 08:53:42 pm »
625 :3 You intentionally switch the 3 and : in order to get the :3 (true story).
6254: Before you even find an existing version of a game or routine, you make it yourself (true story).

493
TI Z80 / Re: Snow Demo
« on: January 25, 2014, 08:39:21 pm »
I have all of the coordinates in Y.X format (i.e. Y=7 and X=12 would be 7.12), and each time I need to know if a snowflake is in a spot, I check sum(L1=Y+.01X). If it's 1, a snowflake is in that spot.

494
TI Z80 / Snow Demo
« on: January 25, 2014, 08:22:52 pm »
This is a demo of snow falling that I made. Basically, press any key to exit.

There is no melting yet. I'm still working on it.

If you want more information, ask me.


495
Introduce Yourself! / Re: about me!
« on: January 25, 2014, 07:27:46 pm »
welcome fellow tanki player!

I play too, ill send u a friend request


ps how do i get mine like this...





you need to be staff or have 1000 posts


sadface

how can i be a staff?
any requirements?

I think you are more likely to get >1337 posts...

Also, remember quality, not quantity.

And this looks like the beginning of a quote tree...
* flyingfisch runs
Let's keep the tree running!


And welcome to Omni! I just have no peanuts. :(

Pages: 1 ... 31 32 [33] 34 35 ... 40