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.


Topics - M. I. Wright

Pages: [1]
1
TI Z80 / Fruit Ninja for the CSE
« on: March 19, 2015, 11:39:50 pm »
If you want to see how this looked like when it first started, go to this Cemetech thread, but from now onwards I'll be crossposting everything from there to here and vice versa.

Anyway! This is an attempt to clone @Deep Thought 's monochrome Fruit Ninja game for the color calcs using xLIBC (as such, it requires Doors CSE to run). The control scheme is pretty similar so far (swipe across the keypad to draw a line onscreen, the screen is mapped from the MATH row downwards, every key works except for ON) except for those annoying dots that appear... but those'll be fixed easily enough.
A demo:


Download here (If you just want the program without the background pic, that's here). The code alone is here.

edit: some more important info from the Cemetech thread--
Quote
For those wondering how it works:
You may have noticed that the TI-OS's getKey command maps keys by row, then column. Using the ᴇ, iPart() and fPart() commands, the program extracts those row/column values, multiplies them to make them usable on the screen, and uses the multiplied column value/multiplied row value as X/Y coords to draw the line.

The example in the video uses xLIBC to draw the lines , but I have one that just moves an O around on the homescreen using pure TI-BASIC; that can be found here. (code here)

2
TI-BASIC / Using {Yx} as a variable and modifying X/Y Min/max
« on: February 11, 2015, 11:23:19 pm »
Hey there! So I just got started on TI programming this afternoon; since then, I've made a program that will graph any form of equation. It works quite nicely, as a matter of fact (I've attached a .8xp and you can see the code HERE). I wanted to add something, though, and it doesn't seem to work that well:

[I'm using the slope-intercept part of the code as an example because it's the easiest]

Code: [Select]
:If Q=1
:Disp "y=Mx+B"
:Disp ""
:Prompt M,B
:"MX+B"→{Y1}
:B+5->Ymax:-B-5→Ymin
:{Y1}/M-B → Xmax:({Y1}/M-B)*-1→Xmin

The last line is what I'm referring to (the last two lines aren't in the .8xp or the Pastebin I linked). I'm trying to make it so that it automatically sets the window to something that'll fit the equation, and while the second-to-last line works perfectly, it seems that the calculator runs into problems using Y1 as a variable. Just to test it, I tried 'calculating' Y1 on its own, and, well...



...yeah. This was with Y1 [in the Y= window] set to "6x+5".

So, two questions- first, why is Y1 so astronomically high compared to what I put in? Second, how can I make it work with the equation? [because the equation needs a Y-value to work; the whole point of it is to solve for X]

I hope this made sense... thanks for taking time out to read it!

EDIT: Yep, that made no sense. BASICALLY what the last two lines in the code do is try to adjust the Ymin/max and Xmin/max values according to the X and Y intercepts. The Y-intercept code [second-to-last line] works flawlessly, but the last line is having trouble.

Pages: [1]