warren

Calgary, Canada

Age: 29

I am a java programmer and a philosopher. Nothing annoys/interests me more than a problem I can't solve. I also like video games.

Nov
15
awarded Revival
Sep
11
comment Position of player is incorrectly calculated
How did I fail to explain this so badly? The error is in the order of the position and velocity vectors in that sentence. One implies that the result of the addition updates the velocity, which is clearly incorrect. One implies that the addition updates the position, which is necessarily true by the relationship of position and velocity. There is an alternate interpretation of a sentence containing the word 'to', but it does not make sense in context: An error that results in the wrong value stored needs to be analyzed in terms of assignments, not accesses.
Sep
7
comment Position of player is incorrectly calculated
ugh... (a+=b) != (b+=a)
Sep
5
comment Position of player is incorrectly calculated
The velocity is being added to the position.
Sep
4
awarded Autobiographer
Sep
4
comment Position of player is incorrectly calculated
I agree. with my hypothesis shot down, I am left to conclude that the error is probably not in the supplied code. Also, I thought the error in the first line would be fixed by now (position adding to velocity?)
Sep
3
comment Position of player is incorrectly calculated
Hey, is your gravity set in the x dimension?
Aug
25
answered Fast stable sort for small arrays (under 32 or 64 elements)
Aug
25
comment In Java, Struggling with returning a color
There seems maybe a fundamental error here? You have two constructors for an enum and neither of them is a convenience constructor for the other. This is setting off alarm bells in my brain. Set all your fields to final and see if you expose any new errors.
Aug
25
comment Represent a number as a sum of a subset of an array
My second solution as outlined is literally the exhaustive search. It may take a long time, but if you want guarantee, it is right there above this comment.
Aug
25
awarded Autobiographer
Aug
25
answered Fastest way to sort 10 numbers? (numbers are 32 bit)
Aug
25
comment Represent a number as a sum of a subset of an array
canAdd is testing if element i can be added. For the purposes of this problem, if K==4, it searches for two other elements already in the list (a,b) such that a+b+i==S as if a+b+i==S, i cannot be legally added.
Aug
25
comment Codechef "Primality Test" Wrong answer
I may not be familiar with codechef, but sieves only work for lists of consecutive numbers.
Aug
25
comment Factor table algorithm with complexity O(n·sqrt(n))
IIRC, if f(x) is O(n log (n)) then f(x) is also O(n^1.5).
Aug
25
answered Represent a number as a sum of a subset of an array
Aug
25
answered Factor table algorithm with complexity O(n·sqrt(n))
Aug
24
answered to generate random permutation of a array in O(n) time and O(1) space
Aug
24
comment Permutation in graphs
I cannot think of a complete solution, In particular, I cannot see how the author manages to calculate out exactly n variants of a given solution, but the graph referred to in part B is probably the best friends directed graph which is the logical place to start at for finding a solution (for each node with more than one incoming arrow, subtract the extra from the max number satisfiable count (as only one gets to stand to the right)).
Aug
24
answered Bitwise Operation to check string is unique
1 2 3 4 5