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

Pages: 1 ... 25 26 [27] 28 29 ... 70
391
TI Z80 / Re: TIConvert
« on: February 28, 2011, 09:15:38 pm »
It's nice to hear that it works :)


Currently, I'm trying to convert text to 8xp, but it runs outrageously slow and has the most vexing habit of occasionally chopping off characters at the start of a new line. /frustration

392
TI Z80 / Re: Chess
« on: February 27, 2011, 12:30:57 am »
Chess?

* Michael_Lee downloads immediately

393
Computer Programming / Re: Easy way to make a compiler? :P
« on: February 26, 2011, 11:00:12 pm »
If it's syntax, check to make sure you added your colons and correctly closed all your parenthesis, braces, and such?  In IDLE, the brackets look very similar to parenthesis, at least for me...

If it crashes while running the script, make sure that you opened it in the first place?

394
TI Z80 / Re: TIConvert
« on: February 26, 2011, 12:52:43 pm »
*Sigh*

After much consternation and experimentation, I finally managed to turn it into an exe.

I tested this on two other computers, so I think it should work, at least on Windows computers (although the included batch file failed to run on my admittedly antiquated XP laptop).

I fixed some issues with ElseIf and ReturnIf, and rewrote the parsing part because I didn't like my older design.

395
Computer Programming / Re: Easy way to make a compiler? :P
« on: February 25, 2011, 10:06:44 pm »
Yup, no problem!  Glad to help.

Just be aware that most forms of input will automatically turn single slashes into double slashes, so you probably won't have to account for those (although you should test to be certain).

396
Correlation / Re: Correlation: Correlific Mode!
« on: February 25, 2011, 07:58:34 pm »
TI-Basic at almost Axe-like speed?

I can't wait to see!

397
Computer Programming / Re: Easy way to make a compiler? :P
« on: February 25, 2011, 07:54:52 pm »
Well, assuming you have a space dividing the word and the number, and assuming follows the format you gave, and assuming that there's only one command per line (wow, I'm assuming a lot of things, aren't I?), here would be a basic script that takes a text file named 'thing.txt' and creates a second text file named 'otherthing.txt' (although you probably would end up wanting this to to automatically generate the output file name).

Code: [Select]
import sys

table = {"If":"21",
         "While":"32",
         "etc...":"25",
         ...
         "For":"91"}


input_path = "C:\\Users\\TheGame\\SomeDirectory\\thing.txt"
output_path = "C:\\Users\\Lobster\\n_example\\otherthing.txt"
# The double slashes are recommended - you don't want to accidentally have a '\n' somewhere.

input_file = open(input_path, "r")
output_file = open(output_path, "w")



for line in input_file:
    cut = line.index(" ")    # This searches for the position of the space
    replacement = table[line[0:cut]]
    output_file.write(replacement + line[cut+1:] + "\n")
    # Just doing line[cut:] would include the space.



input_file.close()
output_file.close()

Print("Done!")



It's a bit simple, but I hope it helps!

398
Axe / Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« on: February 25, 2011, 04:17:00 pm »
I was trying to implement your item removal routine with my "falling sand" style game game, and it crashes my calc!! HELP!

*cough*

How about showing us your code first?  That way, we know what to help you with.

399
TI Z80 / Re: TIConvert
« on: February 25, 2011, 01:27:02 pm »
Indenting is off by default.  (I was learning about command line options, and threw in a bunch to practice :))

And @Scout:
Yeah, it would be pretty cool if this could disassemble assembly into Axe.  But I'd have to learn assembly first  ;D

400
TI Z80 / Re: TIConvert
« on: February 25, 2011, 12:57:56 pm »
It reads Axe source files and turns it into .txt

And I also discovered a bunch of minor bugs, so it might not function as expected.  (Fixing time!)
I should have tested more, I guess.

401
TI Z80 / Re: TIConvert
« on: February 25, 2011, 12:46:00 pm »
I just realized that I uploaded an incorrect version - I had set it up to detokenize a certain file automatically for testing purposes and forgot to change it back.

So to the one person who downloaded this, here's a fix.

402
Introduce Yourself! / Re: Hi, I'm Stefan Bauwens
« on: February 25, 2011, 09:50:59 am »
Cool!  That sounds like an interesting project.

403
Introduce Yourself! / Re: Hi, I'm Stefan Bauwens
« on: February 25, 2011, 09:40:31 am »
Hi -- welcome to Omnimaga!

The peanuts are the way we greet newcomers here -- it's sort of like a meme.

What kinds of games/projects are you working on right now?

404
Computer Programming / Re: Easy way to make a compiler? :P
« on: February 25, 2011, 01:39:03 am »
I would recommend Python, but then again, I'm a Python fan so I'm a bit biased.

If you're guaranteed a space between the word and the four digit number, try using index to find the location of the space, splice the string, then use that string to look up the appropriate value from the dictionary.  Or something.  Just throwing suggestions out there.

I could help out a little if you want, because today I was actually doing something similar to what you seem to be doing.

405
TI Z80 / Re: TIConvert
« on: February 24, 2011, 11:02:43 pm »
Well, the main thing is that it automatically adds indents to the code.  It's always irritated me that no other program did that for me (at least, I think) because I find it really helpful for understanding my code. 

Pages: 1 ... 25 26 [27] 28 29 ... 70