« first day (6 days earlier)      last day (51 days later) » 

07:45
in The Nineteenth Byte, 2 hours ago, by Sherlock9
@zyabin101 So my friend who is also a programming guy and also an engineering guy took one look at UGL and decided to try implementing it in Arduino
 
3 hours later…
10:35
in The Nineteenth Byte, 5 hours ago, by Sherlock9
Not very soon, since he's busy as heck, but I thought you'd be glad to know
He said around May
>>> def isPrime(n):
	for x in range(2, n):
		if n % x == 0:
			return False
	else:
		# loop fell through without finding a factor
		return True
So this is the prime_checker in Python
@KennyLau Yup.
See Mars Ultor's progress above
is there no equality operator?
@KennyLau Nope.
10:45
no negation...
@KennyLau Nope.
how would i check for equality?
idk
I have to add conditionals and negation operator to the TODO list for May.
def isPrime(n):
	stack.push(1)
	stack.push(n)
	stack.pick()
	stack.pick()
	while stack.pop() - stack.pop():
		stack.swap()
		stack.inc()
		stack.swap()
		stack.pick()
		stack.pick()
		stack.push(divmod(stack.pop(),stack.pop()))
		stack.swap()
		stack.discard()
		if stack.pop() == 0:
			stack.push(0)
			print(stack.pop())
			stack.duplicate()
			stack.duplicate()
			stack.duplicate()
	if stack.pop() - stack.pop():
		# loop fell through without finding a factor
		stack.push(1)
		print(stack.pop())
to check for zero:
stack.push(1)
stack.swap()
if stack.pop():
	stack.dec()
#The stack now becomes 0 if it started not zero, and vice versa.
 
3 hours later…
13:28
@zyabin101 wat why
@MarsUltor Kenny Lau wanted them.
Also, you have to implement registers. Look in the UGL repo's master branch.
@zyabin101 When do you want it done by?
@MarsUltor Tomorrow.
@zyabin101 How do you switch registers?
@zyabin101 halp the current readme isn't very informative
@MarsUltor s pops an integer from the stack and switches to the register with the number popped.
13:40
@zyabin101 How many registers?
@MarsUltor Infinite.
R pops an integer and writes it into the current register.
@zyabin101 Not infinite?
That value may then be read by using r, if the current register is correct.
@MarsUltor Then infinite.
um
load/save???
@MarsUltor Read/write.
13:44
yeah
but
what do those do to the stack
@MarsUltor s pops an integer to determine which register to select.
Yeah, done that
what do r and R do?
R pops an integer to write into the current register.
r pushes the value of the current register to the stack.
@zyabin101 Does the current value of the register stay the same?
@MarsUltor Yup.
13:46
@zyabin101 If there's no value, it pushes 0, right?
@MarsUltor Right.
@zyabin101 I think it's done, not sure if you want to test it
14:42
Whoops, wrong room.
15:09
@StackFeeds >:|

« first day (6 days earlier)      last day (51 days later) »