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

Pages: 1 ... 57 58 [59] 60 61 ... 208
871
News / Re: OS 3.2 blocks Ndless
« on: August 29, 2012, 09:20:44 pm »
It's not uncommon for stores to have outdated OSes. They probably had it in stock since last september.

872
Pokemon Red / Re: Pokemon Red
« on: August 18, 2012, 10:54:40 pm »
pitas are tasty. :P

873
Ndless / Re: Ndless suggestions thread
« on: August 18, 2012, 10:42:37 pm »
Lol, I wrote the 84+ key constants about a year and a half ago. Are they still the same?

874
Computer Projects and Ideas / brainfsck in python by willrandship
« on: August 17, 2012, 12:43:18 am »
Code: [Select]
Just a little project I'm working on. It's not working yet, but it should be  :banghead:

[code]#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
#  untitled.py

#  Copyright 2012 Unknown <william@willdesktop>

#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.

#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.

#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.


import sys

try:
prog = open(sys.argv[1],'r')
except IndexError:
print ("Usage: python script program")
exit()
except IOError:
print("File Not Found")
exit()

BYTE_MAX = 255 #These values are the default for an 8-bit implementation.
ARRAY_MAX = 29999

loops = {}
ptr = 0

array = []
for a in range(30000): #Give array the proper dimensions
array += [0]


#These are the executing functions for the commands.

def inc_ptr():
global ptr,ARRAY_MAX,BYTE_MAX,loops,array
ptr += 1
if ptr > ARRAY_MAX:
ptr = 0

def dec_ptr():
global ptr,ARRAY_MAX,BYTE_MAX,loops,array
ptr += -1
if ptr == -1:
ptr = ARRAY_MAX

def inc_byte():
global ptr,ARRAY_MAX,BYTE_MAX,loops,array
array[ptr] += 1
if array[ptr] > BYTE_MAX:
array[ptr] = 0

def dec_byte():
global ptr,ARRAY_MAX,BYTE_MAX,loops,array
array[ptr] += -1
if array[ptr] == -1:
array[ptr] = BYTE_MAX

def out_byte():
global ptr,ARRAY_MAX,BYTE_MAX,loops,array
print (chr(array[ptr]))

def in_byte():
global ptr,ARRAY_MAX,BYTE_MAX,loops,array
array[ptr] = ord(input("In: ")[0:1]) #Python3 uses input, python2 uses raw_input. change if it nameErrors. (2 because of unrecognized chars, 3 because raw_input is meaningless.)

def in_loop(run_line):
global ptr,ARRAY_MAX,BYTE_MAX,loops,array
if array[ptr] == 0:
run_line = loops[run_line]
print ("Jumped to "+str(run_line))

def out_loop(run_line):
global ptr,ARRAY_MAX,BYTE_MAX,loops,array
if array[ptr] != 0:
run_line = loops[run_line]
print ("Returned to "+str(run_line))

#These are other functions, mostly for startup prep.

def find_loops():
global loops
global prog
op_num = 0
in_loops = []
out_loops = []
for line in prog:
for char in line:
if char == "[":
in_loops += [op_num]
if char == "]":
out_loops += [op_num]
op_num += 1

if len(in_loops) != len(out_loops):
print ("Error: Nonmatching bracket count.")
exit()

for a in range(len(in_loops)):
loops[in_loops[a]]  = out_loops[a]
loops[out_loops[a]] =  in_loops[a]
print ("Found "+str(len(in_loops))+" loops")

def filter_prog(): #Currently unused
global prog
op_str = ""
for line in prog:
for char in line:
if char in "><+-.,[]": #Eliminate useless characters
op_str += char
op_str += "!" #Signals an EOF. Don't worry, you can still have ! in the file elsewhere.
return op_str

def exec_op_str(op_str):
op = ''
op_num = 0
while op != '!':
op = op_str[op_num]

#Contains the if statements for all the commands, executing them.
if True: #For grouping purposes
if op == ">":
inc_ptr()

if op == "<":
dec_ptr()

if op == "+":
inc_byte()

if op == "-":
dec_byte()

if op == ".":
print ("Printed a char")
out_byte()

if op == ",":
in_byte()

if op == "[":
in_loop(op_num)

if op == "]":
out_loop(op_num)
op_num += 1


def main():
global array, prog
find_loops()
prog.seek(0)
op_str = prog.read()
exec_op_str(op_str)
print (array[0:100])
return 0

if __name__ == '__main__':
main()

Oh btw {code} turned my tabs into spaces, but the code should still work fine.[/code]

875
Pokemon Red / Re: Pokemon Red
« on: August 16, 2012, 06:05:00 pm »
I have 2 GBCs, pokemon Red, Blue, Fire Red, Ruby, Crystal (somewhere), Gold, and 2 Flash carts. I'm not too jealous. :P

876
TI-Nspire / Re: gpSP-Nspire (GBA Emulator)
« on: August 16, 2012, 05:35:56 pm »
And there you have it ;D

Now we can all judge calc84's coding style. :P

877
TI-Nspire / Re: gpSP-Nspire (GBA Emulator)
« on: August 16, 2012, 05:22:06 pm »
It is indeed licensed under GPL v2. I'm not sure where the source code is *cough cough* but I'm sure it'll turn up soon.

878
Ndless / Re: Ndless suggestions thread
« on: August 16, 2012, 05:17:48 pm »
That would cause program incompatibility to fix something that only adds maybe 100 bytes to your compiler setup. It shouldn't affect programs at all, since those are macros, and they're simply #defined into the program as numbers.

879
Pokemon Red / Re: Pokemon Red
« on: August 16, 2012, 05:12:49 pm »
Never turn down a new set of calculator internals...I mean, a gameboy.

880
TI-Nspire / Re: gpSP-Nspire (GBA Emulator)
« on: August 15, 2012, 11:46:37 pm »
Yeah. Golden Sun was one of the best games for the GBA, but the sequel would be quite confusing if you hadn't played the first. Very story-oriented.

881
TI-Nspire / Re: gpSP-Nspire (GBA Emulator)
« on: August 15, 2012, 11:43:10 pm »
By the way, I would be willing to bet Golden Sun 2 runs even worse than 1, because it used the same engine with a bunch more things thrown in that could screw it up. It shouldn't be any better, at least.

Oh, and in POWDER where the darkened areas were staying darkened, were you listed as "blind" at the time? If so that's intentional. A darkened area is a "known" area whereas a lit area is a "seen" area. Blind people can't see anything :P

882
ASM / Re: Why wouldnt this work?!
« on: August 15, 2012, 05:16:57 pm »
Quick question: When you say 'not working' could you clarify? Does it crash? Does it get the characters mixed up? Does it do absolutely nothing? That would help diagnose what is actually happening.

Oh, and keep in mind str1 is stored in tokens, not ASCII.

883
ASM / Re: Why wouldnt this work?!
« on: August 14, 2012, 12:16:28 am »
So wait, is this supposed to put the string you're assembling with in as the Program's contents in a basic editor? If so, I bet the problem is that you're confusing Strings (ASCII-ish) and tokens (not so ASCII-ish) That would garble some stuff, but not all. For instance, a space in ASCII is randM or something in prgm tokens, but I think all the uppercase letters are the same.

But I'm no good at real assembly.

884
Pokemon Red / Re: Pokemon Red
« on: August 14, 2012, 12:08:35 am »
Isn't there a "Dead Projects" forum it can go in?

885
TI-Nspire / Re: gpSP-Nspire (GBA Emulator)
« on: August 13, 2012, 09:16:16 pm »
well, the game dithers areas you can't see with black pixels. Is that what you're referring to?

Pages: 1 ... 57 58 [59] 60 61 ... 208