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 - Jim Bauwens

Pages: 1 ... 72 73 [74] 75 76 ... 125
1096
Lua / Re: Random color select in a faster way
« on: November 11, 2011, 06:03:18 am »
You could use this:
Code: [Select]
colortable = {{255,0,0}, {0,255,0}, {0,0,255}, {255,0,255}, {0,255,255}, {255,255,0}, {255,150,0}}
setColorRGB(unpack(colortable[math.random(#colortable)]))

This way you can easily add colors, and it will continue to work :)

1097
TI-Nspire / Re: NES EMMULLLATOR (FOR NSPIRE!)!
« on: November 10, 2011, 01:19:06 pm »
@AOC, I'm sorry, the 2600 was the first one they released, didn't look good enough. The 6502 processor is pretty easy to emulate, but I also just realized that I can't have a good clock in Lua, the fastest I would have would be 100Hz :(

@goplat, I know bitwise operators are issue's, but I can try to optimize them in bytecode (yes, the nspire can run bytecode).

Anyway, its hard, but I *think* that you can emulate some old devices with Lua. I know that there is a gameboy emulator written in Lua, but thats for a PC (its a mod for a game).

1098
Other Calculators / TI-Nspire update request method
« on: November 10, 2011, 12:15:14 pm »
I've made a little script to requests TI's servers for updates. It uses the method as the students software (I 'reverse engineered' it :p)
Code: [Select]
#!/usr/bin/python
import httplib2
from xml.etree import ElementTree as ET

REQUEST_URL = "http://education.ti.com/ws/webUpdate/queryForUpdate"

root = ET.Element("QueryUpdates")
Request = ET.SubElement(root, "Request")
WebUpdateClientName = ET.SubElement(Request, "WebUpdateClientName")
WebUpdateClientVersion = ET.SubElement(Request, "WebUpdateClientVersion")
WebUpdateClientOS = ET.SubElement(Request, "WebUpdateClientOS")
CurrentVersion = ET.SubElement(Request, "CurrentVersion")
LanguageCode = ET.SubElement(Request, "LanguageCode")
WebUpdateClientEncoding = ET.SubElement(Request, "WebUpdateClientEncoding")
RequestType = ET.SubElement(Request, "RequestType")
CalculatorModel = ET.SubElement(Request, "CalculatorModel")

WebUpdateClientName.text = "TI-Nspire Computer Link Software"
WebUpdateClientVersion.text = "1.4.0.539"
WebUpdateClientOS.text = "Linux"
CurrentVersion.text = "3.1.0.392"
LanguageCode.text = "NL"
WebUpdateClientEncoding.text = "ISO-8859-1"
RequestType.text = "OS"
CalculatorModel.text = "TI-Nspire"

bodyrequest=ET.tostring(root)

h = httplib2.Http(".cache")
resp, content = h.request(REQUEST_URL,"POST", body=bodyrequest)
root = ET.XML(content)


Response = root[1]
ProductInfo = Response[1]

for node in ProductInfo:
name = node.__str__().split("\'")[1]
if node.text:
print(name + ": " + node.text)


Now, here is the response:

ProductID: 7953
ProductName: TI-Nspire Handheld Operating System
ProductFileSize: 10867233
ProductType: OS
ProductRevision: 3.1.0.392
ProductCalculator: TI-Nspire
Name: TI-Nspire
ParentProduct: TI-Nspire™ Handheld Operating System
ForceUpdate: N
UpToDate: Y

I highlighted something creepy, "ForceUpdate". Does this mean that TI can update your calculator without asking you?
Image TI makes a fix for Ndless 3, and they are able to update the calculators of unknowing people just because they connected it with their computer (to send a game for example).

Scary...

1099
TI-Nspire / Re: NES EMMULLLATOR (FOR NSPIRE!)!
« on: November 10, 2011, 10:30:49 am »
Well, I think I would be able to create one of the first machines. I've checked some info and looked at specs, and I think its possible :)

1100
Lua / Re: Color tetris
« on: November 10, 2011, 07:11:23 am »
Good job Nick :)

1101
TI-Nspire / Re: NES EMMULLLATOR (FOR NSPIRE!)!
« on: November 10, 2011, 07:09:11 am »
Yes, NES would be definitely too slow (not that its not possible).
But there are some older atari machines that *might* be possible to be emulated in Lua, but someone will have to spend allot of time working on it.

1102
Site Feedback and Questions / Re: New code box has a little bug
« on: November 10, 2011, 04:34:11 am »
I'm using that theme. I noticed that it works on my mobile phone, but not in firefox 7. Strange.

1103
Lua / Re: Color tetris
« on: November 09, 2011, 04:22:16 pm »
fillRect is much faster than drawimage, so I suggest you to use that :)

1104
Lua / Re: Bubble shooter
« on: November 09, 2011, 02:45:47 pm »
Nick, funny post times :)
But I would recommend not to double post, rather edit your last post ;)

1105
Lua / Re: Bubble shooter
« on: November 09, 2011, 02:41:23 pm »
Nick, thats a nice game :)
I've been thinking of making it, but never did.

I hope you have fun programming!

1106
TI-Nspire / Re: [lua] Logo interpreter
« on: November 09, 2011, 11:53:53 am »
Sure, first i'll expand it (short function names to long function names):
Code: [Select]
;define subroutine sierp
to sierp :n :l
    ;if the level is zero, stop
    if :n=0 [stop]

    ;Draw 3 lines for the triangle, while calling itself recursively (to draw the triangles on the sides)
    repeat 3 [
        sierp :n-1 :l/2
        forward :l
        right 120
    ]
end

;put the turtle on the right spot
penup
back 100
left 90
back 100
pendown

;Draw a sierpinski triangle, 5 levels deep (200 is the size)
sierp 5 200

That should be clear enough :)

1107
Site Feedback and Questions / New code box has a little bug
« on: November 09, 2011, 11:06:29 am »
Before I used to put the Language I used inside the code bb box, [ code = language ].
Now this doesn't work anymore, and it replaces the content of the code box with "Array".

Like this:
Code: (Lua) [Select]
function on.paint(gc)
  gc:drawString("bugged!",10,10,"top")
end

This means that all the code boxes in the entire forum that have the language parameter added don't show their content anymore.

Would be nice if it got fixed ;D

1108
TI-Nspire / Re: [lua] Logo interpreter
« on: November 09, 2011, 10:44:04 am »
While there is already a sierpinski curve included, here is sierpinski's triangle (not included):
Code: [Select]
to sierp :n :l
    if :n=0 [stop]
    repeat 3 [sierp :n-1 :l/2 fd :l rt 120]
end

pu bk 100 lt 90 bk 100 pd
sierp 5 200

This is the result:

1109
Miscellaneous / Re: Can GameGear games be emulated in nSpire v2?
« on: November 09, 2011, 04:32:54 am »
Note that it's not impossible.  It's just near impossible.  ;)
+1, because its just so well worded.

1110
News / Re: Deep Thought becomes manager
« on: November 09, 2011, 04:27:52 am »
Congratulations! You deserved it :)

Spoiler For The effect:
You all lose The Game

Pages: 1 ... 72 73 [74] 75 76 ... 125