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 - AngelFish

Pages: 1 ... 211 212 [213] 214 215
3181
Axe / Re: Weighted average in Axe
« on: September 27, 2010, 02:07:55 pm »
I've actually needed weighted random numbers in BASIC a few times and I found the following algorithm useful. I generally used it to change variable domains, but that's just a special case of the method.

1) Divide your input interval [A, B] into a finite number of subintervals [A_0, A_1], [A_2, A_3],...[A_n, B]
2) For each interval, assign a desired output probability and a total output range.
3) For each subinterval, create a linear function f(x) that maps the interval to the total output range multiplied by the probability of occurrence.
4) Offset each successive linear function to the endpoint of the function immediately preceding it.
5) Run the generator.

This method tends to be rather fast at generating weighted numbers and can be implemented fairly easily in most languages. However, it has a few problems, namely that the algorithm often produces numbers that are inconsistently less precise than those put in. You can get around this by truncating the output to a fixed number of decimals. Also, this method is an approximation of a true distribution, so it doesn't perfectly weight the numbers. It also fails to change the probability that any of the mapped intervals will occur. For example, the interval [F(A_0), F(A_1)] will occur precisely as often as [F(A_2),[F(A_3)]. However, normally you don't care about the intervals, only the numbers themselves, so this shouldn't be much of a problem.

This is all assuming you can even get Axe to support decimal arithmetic, of course.
 :)

3182
Axe / Re: Tilemapping
« on: September 26, 2010, 05:43:14 pm »
I never had to wait that long to transfer. It can usually be done in 6-7 for me. That said, I've been known to underestimate times before.

3183
Axe / Re: Tilemapping
« on: September 26, 2010, 05:30:00 pm »
It had something to do with my firewall blocking the connection between TI-connect and the calculator. Whenever I would transfer files, it would interrupt the communication and when I disconnected the calculator out of frustration, I wouldn't have an OS the next time I booted. Since the computer doesn't deal with data on peripherals unless I tell it to, I'm fairly sure it wasn't the one to erase my OS. It was kind of annoying the first time it happened because I was trying to transfer a very large and useful BASIC math program that I had spent three months writing. Needless to say, I never tried to rebuild it.

I fixed the problem by playing around in the system settings for a few hours days and learning to keep a backup OS on hand.

EDIT: Looking back, it does sound a lot more like my firewall than TI-Connect.

3184
Axe / Re: Tilemapping
« on: September 26, 2010, 05:19:32 pm »
I blame TI-Connect :P
It erased my OS every time I transferred files between my calc and my computer. I fixed the problem only a little while ago.

3185
Axe / Re: Tilemapping
« on: September 26, 2010, 05:14:14 pm »
I've been archiving a lot lately rather than backing up, ever since I noticed that erasing the OS doesn't clear the archives. Backing up to a computer is too difficult for me to do regularly.

3186
Axe / Re: Tilemapping
« on: September 26, 2010, 04:58:45 pm »
Oops ;D

Flipping that around changes the output, but now the screen has a bunch of random sprites on it.

Apparently after the compressed data stops, it reads the next byte in the ram. Hm, I always wondered what the data looked like in the memory.

3187
Axe / Tilemapping
« on: September 26, 2010, 04:47:43 pm »
I'm trying to start a new project and I was looking through Eeems' tutorial on program flow*. I understand the RLE part, but running the code verbatim in my calc doesn't appear to work. Here's the code I have programmed:

Quote
ClrDraw
DiagnosticsOff
[0515]->GDB1
[FFFFFFFFFFFFFFFF0000000000000000]->Pic1

0->N
0->I

While I>=96
{GBD+N}->A
N+1->N
A^16->B
A/16->A

For(F,0,B)
A->{L1+I}
I+1->I
End

End

For(X,0,11)
For(Y,0,7)
{Y*12+X+L1}->A
Pt-On(X*8,Y*8,A*8+Pic1)
End
End
Dispgraph
While getkey?9
End

If I understand the routine correctly, it should display a series of sprite columns. As it is, the whole screen is covered in the black sprites without any gaps for the blank sprites. Does anyone have an idea of what might be wrong with it?


*http://ourl.ca/4317

3188
TI Z80 / Re: Axe Cuberunner
« on: September 26, 2010, 02:17:10 am »
It looks great!

But some sort of depth of field reference line, like an artificial horizon, might make the graphics slightly nicer at no real computational cost. The cubes spontaneously appearing on the empty horizon just looks a bit odd to me.

3189
Humour and Jokes / Re: 9001 signs you're addicted to calcs and Omni
« on: September 26, 2010, 01:13:27 am »
573: You've written a symbolic math program for your calculator.

574: Your professor has banned calculators for the entire class because of 573.

3190
The Axe Parser Project / Re: Features Wishlist
« on: September 25, 2010, 05:08:19 pm »
Sorry about the topic , but wouldn't B<>EXP2 be false for all B≠EXP2. I see how that would work.

3191
The Axe Parser Project / Re: Features Wishlist
« on: September 25, 2010, 04:44:22 pm »
Is there a way to use the NOT() function in Axe? I've come across situations a few times where I want to test for a non zero value and a zero value in a conditional.

For example:

Code: [Select]
:If A and Not(B)
:Conditional code
:End

I can't figure out how I would do it in Axe, so I end up using
Code: [Select]
:If A
:!If B
:Conditional code
:End
:End
which would appear to be less efficient.

Basically, if there isn't a NOT() function for expressions in Axe already, it'd be nice to have one. Even if the function isn't more efficient, sometimes the End statements get a bit messy and it'd be nice to eliminate as many as possible.

3192
The Axe Parser Project / Re: How quick is Axe?
« on: September 14, 2010, 03:05:19 pm »
I think a lot of my Axe programming may be limited by my tendency to use BASIC.
Could someone just tell me how fast Axe is?

Thanks.

When I first switched to Axe, I converted a program I had written in BASIC to Axe. The program ran between 30 and 40 times faster in Axe with a 1:1 conversion between the languages. If I had optimized the Axe code, I could easily have doubled that.

However, I determined that a god portion of that lag was the LCD driver. When I eliminated the differences in Driver time, it slowed down to about 20 times the speed.

3193
Axe / Re: Grayscale title screen editor
« on: September 13, 2010, 12:36:36 am »
With a few modifications, it's compiling.

But there are more efficient ways to crash my calc... ::)

Really, what is this "Input" command?

3194
The Axe Parser Project / Re: Features Wishlist
« on: September 07, 2010, 03:23:37 pm »
Wouldn't surprise me. My luck with software as of late has been less than desirable to say the least.

3195
The Axe Parser Project / Re: Features Wishlist
« on: September 07, 2010, 03:08:19 pm »
I'd try that advice if I hadn't already tried it. The last multiple post was the result of one submission. I pressed the button and didn't touch my phone until it had sent it. I mean that literally. I set the phone down on my desk and watched it. I think I'll just stick with a computer from now on.

PS: I tried to delete all of the extra posts I had made. Apparently I missed a few.

Sorry.



Pages: 1 ... 211 212 [213] 214 215