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 - Michael_Lee
Pages: 1 ... 8 9 [10] 11 12 ... 70
136
« on: August 08, 2011, 10:51:55 pm »
My Website: http://www.programs-of-3rik.co.cc
Curses! I lost the game. Welcome to Omnimaga! Like I'm sure everybody else is saying, feel free to ask loads of questions -- even ones that aren't related to calculator programming in particular.
137
« on: August 08, 2011, 11:18:57 am »
Hi! Welcome to Omnimaga!
138
« on: August 07, 2011, 12:30:41 pm »
Awesome stuff! For some reason, I've never figured out how to make my text control as fancy as that...
ephan is using an awesomesauce special text editor thingie specially designed for code. I would still like a CLI only version, even if it's just importing the decoding library and calling it.
That should be easy. For now, just run 'console.py' (get the version from the repository, not the downloads, which has a few bugs). == Add option to detokenize into Axe OR Basic tokens. And as a plus, a menu option to instantly switch tokens to and from Axe!
That should be pretty easy. Actually, even though Croquette is supposed to only work with Axe, it'll still convert TI-Basic tokens anyways. I don't encourage it (due to code-readability reasons), but you can mix and match Axe and Basic tokens freely, and still have it convert. We'll look into adding a menu option for fully switching. == Solving the "token vs. letter" problem by catching keyboard and mouse input to avoid positioning the cursor in the middle of a token, and maybe coloring it as well? (optional, but pretty cool, and you guys will be the only one who has done it successfully... if you can, that is.) This will require a different file format specific to Croquette, like 8xpxml to distinguish letters from tokens.
Hmm. This one might be a bit trickier. == Intellisense Sounds insane, but my theory of Intellisense is that it's just a non-focused wxFrame, with a wxListBox inside it. If you guys manage to do it, you will gain quite a bit of notoriety from the wxWidgets community. (Again, this is optional, but something to aim for if you can do it! ) Also include a help box - something like VC++/VB, where they show a yellow box as you type telling you how to use the command.
@ephan: doesn't wx.stc come with a bunch of autocompletion methods?
139
« on: August 05, 2011, 01:04:12 pm »
even better version:
import rock_paper_scissors
play() ...is it sad that I actually tried this, and honestly believed it would work? while 1: #more idiomatic, and very slightly faster than "while True:"
Huh, I didn't know that. It seems that's the case only for Python 2.x though -- in Python 3.x, there's no difference between the two, apparently.
140
« on: August 05, 2011, 01:30:45 am »
So, a few quick tips: adding three 'breaks' in a row won't make your program jump out of three loops -- the interpreter will see the first break, and will jump out of your while loop and ignore all the other 'breaks'.
Instead, either restructure your program so that it'll change a variable that'll let you quit, or import the module 'sys' and do 'sys.exit()'.
Also, lists in Python are awesomely useful. In this particular case, I was able to use lists to optimize away several 'if' statements.
Here's slightly more optimized version that I wrote:
import sys import random
# A list containing all your choices. choices = ["rock", "paper", "scissors"]
# I added an underscore because I think 'quit' is a keyword in python. quit_ = "quit"
while True: playerchoice = 0 playerpick = ""
# The computer will pick a number from zero up to (but not including) three. compchoice = random.randrange(0,3)
# This way, it'll keep looping until you enter a valid input. while playerpick not in choices: playerpick = raw_input("choice:")
if playerpick == quit_: # sys.exit() forces the program to quit. sys.exit()
# Searches the list 'choices' and returns which position the string was in. playerchoice = choices.index(playerpick)
# Optimization. print "vs " + choices[compchoice]
if compchoice == playerchoice: print "tie" elif (compchoice + 1) % 3 == playerchoice: # Also an optimization. print "u win" else: print "u lose"
141
« on: August 04, 2011, 01:58:06 pm »
On Linux, can I save things to the Windows partition, then?
yes you can. if you want to share files, though, you can use the cloud, I think you have a server, don't you?
Cool, that pretty much takes care of all my reservations. I have lots of files, plus I don't entirely trust the cloud. I also don't have a dedicated server (I'm doing free shared hosting), and according to the terms of service, am not allowed to use them specifically to host files.
142
« on: August 04, 2011, 01:22:28 pm »
On Linux, can I save things to the Windows partition, then?
143
« on: August 04, 2011, 12:27:05 pm »
I use Windows 7 for my home computer, and (I think) XP at school.
I'm considering dual-booting Linux Mint with my home computer though, once I upgrade some of its hardware so it's less slow.
Hrm, random question (before I forget) -- if I dual boot both a Linux OS and a Windows OS on the same computer, is there a way to set it up in a way that they can both share each others' files (like my papers for school and stuff, and code I'm writing).
144
« on: August 03, 2011, 11:56:59 pm »
'Ello! Welcome to Omnimaga! If by 'Boxhead', you mean this game (first result from googling), then I think that if you were to simplify the graphics and coded carefully, it would definitely be possible! Which calculator(s) do you have, and what programming languages do you know?
145
« on: August 03, 2011, 10:38:59 am »
Um, Axe doesn't run natively on the Nspire. Are you planning on porting a z80 emulator or something?
I'm also not sure how you would solve the whole "No Goto" thing in Python if you're going to use a Python OS.
True, but you could hack it on http://entrian.com/goto/Welcome to the forums, by the way! If you haven't already, you should definitely make an introduction topic and tell us a little about yourself.
146
« on: August 03, 2011, 10:27:23 am »
*shrug*
It could definitely be fake -- they're keeping everything 'secret', so we have no idea how it works.
Their website says that they should be releasing a demo in a few months, so I guess we'll see if they're really serious?
147
« on: August 03, 2011, 01:54:30 am »
Polygons:
I made a subroutine that can draw a shaded polygon with an arbitrarily high amount of vertexes.
It can also handle convex and almost handle concave polygons.
You have to designate a segment of memory that contains a list of vertex. The 0th byte is the X-coordinate of the first vertex, the 1st byte is the Y-coordinate of the first vertex, the 2nd byte is the X-coordinate of the second vertex, etc... The last pair of vertexes has to be identical to the first pair, to 'close the loop'.
Also, the first (and therefore last) point in the list has to be the left-most or right-most point of the polygon, otherwise it'll look weird.
I made a demo -- source attached, and comments and pic below. [2ND] to place a vertex, [ALPHA] to display the polygon, and [DEL] to clear the screen. [CLEAR] exits.
It should be compatible with Axe 0.5.x and 1.0.x
.POLYGON
Fix 5
10->A .The X coordinate of the vertex selector 10->B .The Y coordinate of the vertex selector
0->T .Total amount of vertexes 20->M .Maximum amount of vertexes (not necessary -- only for sanity checks)
L4->V .Pointer to the list of Vertexes L1->C .Pointer to some free ram (for Calculations)
ClrDraw ClrDraw^^r
RectI(A-1,B-1,3,3)^^r
Repeat getKey(15) RectI(A-1,B-1,3,3)^^r getKey(3)-getKey(2)+A->A getKey(1)-getKey(4)+B->B RectI(A-1,B-1,3,3)^^r Rect(80,9,40,40) RectI(80,9,40,40)
Text(80,10,A>Dec) Text(80,18,B>Dec) Text(80,30,T>Dec) If getKey(54) .Adds a vertex If T<M A->{T*2+V} .The last element in the list must equal the first one. B->{T*2+1+V} T+1->T Pxl-On(A,B) End For(Z,0,20) .Delay for usability DispGraph^^r End End
If getKey(48) .Draws the polygon {V}->{T*2+V} {V+1}->{T*2+V+1} sub(POL,T,V,C) 0->T For(Z,0,20) DispGraph^^r End End
If getKey(56) .Clears the screen ClrDraw ClrDraw^^r RectI(A-1,B-1,3,3)^^r 0->T End
DispGraph^^r End
Return
Lbl POL .Parameters . r1: The total amount of vertexes . r2: A list of vertexes (pairs of X and Y coordinates, each one byte) . r3: A pointer to some free ram (Amount needed == approx. (max polygon width) * 2) . .Destroyed . W, X, Y, Z, r3, r4, r5, r6 . r3->W For(r4,0,r1-1) r4*2+r2->r5 r4+1*2+r2->r6
{r5}-{r6}->X {r5+1}-{r6+1}->Y If X>=>=0 For(Z,0,X) {r5}-Z->{r3} ~Y*Z//X+{r5+1}->{r3+1} r3+2->r3 M+2->M End Else For(Z,0,abs(X)) {r5}+Z->{r3} Y*Z//X+{r5+1}->{r3+1} r3+2->r3 M+2->M End End End
For(Z,1,r3-W/2-1) Line({Z*2+W},{Z*2+W+1},{Z*2+W},{Z*~2+r3+1})^^r End Return
148
« on: August 02, 2011, 10:04:33 pm »
I'm carefully starting to muck about in Haskell at the moment myself. I'm still going through the first few chapters of "Learn you a Haskell." I'm not really sure what I can do with it, though, besides perhaps doing something that needs a lot of threads or processes.
149
« on: August 01, 2011, 03:21:10 pm »
Version 1.0: > Syntax highlighting and line numbers > You can use Croquette IDE via GUI, or via the command-line > Minor bugfixes > TIConvert has been fully merged with Croquette IDE -- TIConvert is no more. Get it here!: https://code.google.com/p/croquette/downloads/listI have only a Windows, but hopefully, a version for Linux and maybe Macs will be up soon. In the meantime, you could always run the source code itself Obligatory pic: (wabbitemu isn't included, it's just to demonstrate.)
150
« on: August 01, 2011, 03:21:06 pm »
Both bugs have been fixed, you can download the latest version at https://code.google.com/p/croquette/. Also, TIConvert has now been formally and completely merged with Croquette -- discussion, requests, complaints, etc... now go here: http://ourl.ca/122725. You can use Croquette in the same way you've always been using TIConvert -- via the .bat file or by using command prompt. Double-clicking Croquette.exe will open a GUI, though.
Pages: 1 ... 8 9 [10] 11 12 ... 70
|