Thanks, I already thought of this one, and expected everyone would do
byte[] b=new byte[99];
With a double for-loop…
Anyway, we’ll see who can do it in 1 for-loop
Thanks, I already thought of this one, and expected everyone would do
byte[] b=new byte[99];
With a double for-loop…
Anyway, we’ll see who can do it in 1 for-loop
http://213.247.55.3:8484/compileandrun/?assignment=reverse
(85 bytes, with 1 for-loop, very hard)
(83 bytes, with 2 while-loops, extremely simple)
You’ve a long way to go yet!
(53 bytes)
Nothing like throwing weighted dice to make sure you win ;D
(no peeking @ the solution Riven 8))
I’ll behave this time… :-*
[hint]
you don’t need to declare a stack
[/hint]
;D
How many bytes? :-X
(Should I be worrying about a StackOverflowException ;))
Sounds like you are on the right track ;D
I think it’s a more scalable solution than one using a stack of byte[99]
Weeee… 53?
got 54 in reverse with a correct comparison c>-1 and 53 with the slightly incorrect one c>0
Was pretty easy to get there.
And here was my initial attempt:
int[] a = new int[99];
for(int o=1;o>0;)
if((a[o++]=in.read())<0&&(o-=2)>0)
out.write(a[o]);
That’s all for today, I’m going to study my exams again.
I was working on this 63 byte solution:
byte[] b = new byte[99];
for (int s = in.read(b); s-- > 0; out.write(b[s]));
but got 53 as soon as you mentioned StackOverflowException
At the moment, you can create an account and submissions will be logged to determine how many people did better than you (if any).
If you’re not logged in, all your submissions will be assigned to the default anonymous user.
http://213.247.55.3:8484/compileandrun/
I made the statistics abolutely anonymous, so you only see how many people had their best solution better/equal/worse than you. No need to post your code again, to prove that you really got it down to so little bytes.
All I can say is, that it is a royal PITA to program a dynamic webpage in Java (without a framework).
Java is simply not suited to handle much text in your sourcecode.
I’m so fed up with Java in this project, that I’m going to convert it to PHP with a Java part that handles the compile&run part. >:(
It’s great that you’ve added accounts now. Super work.
IMHO, it would be even better if you showed the best/equal/worse statistics next to the names of the challenges in the main /compileandrun/?account page. Then you’d know instantly which ones you needed to work on to try to beat the best score.
Cheers, Tim.
Good idea, I’ll do this tonight, before the major overhaul of the site.
I just had my exams, but this week I’m dedicated to a project at school, so again… there is limited time to get things done.
this is pretty cool, but i am no good at optimizing. my attempt at the capitalizer was 113 bytes.
I got 52 bytes for the BitEncoder. No idea how to optimze further…
Hm… I wonder when I’ll have time to finish this one.
Having two jobs and a full-time study pretty much consumes all my time
Oh… ehm… I just noticed the SQL connection got a broken pipe after 1 day Gotta make it reconnect eh?
Update:
It reconnects now… I already wondered why nobody was registering accounts… I thought it was pretty much dead.
Hi Riven,
It looks like the connection has gone again.
Cheers, Tim.
Yeah… debugging something that happens hours later, aint much fun.
When I have time, I’ll convert it all to PHP with a Java backend - as I said earlier.
It should be pretty darn easy and quick to do… but don’t hold your breath.