« first day (1310 days earlier)      last day (3535 days later) » 

12:09 AM
0
A: Sandbox for Proposed Challenges

Calvin's HobbiesProgrammerforte [This is not at all complete. It's just my staging area so I'm sure it's saved.] There are 88 keys on a standard piano and 95 printable ascii characters (hex codes 20 through 7E): !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ...

 
 
2 hours later…
I was challenged to write the shortest c program (in source code byte count) that prints the sum of a sequence of ints starting at 1 with multiples of 2 and 3 omitted (i.e, 1,5,7,11,13,17,19,23,...) of a length given on stdin, and i came up with this:
main(i){scanf("%d",&i);printf("%d",i*i*3/2);}
Can I get it shorter still?
 
@Will do you need an answer in a hurry or would you consider posting it in the sandbox?
 
@overactor: All bots are susceptible to freezing. That's one of the problems with the challenge. There's no defense against the freeze attack except to block writes to every single instruction--or avoid being in front of another bot when it executes an attack.

"Byzantine" does the best it can. It moves constantly so that it can't be targeted by the slower bots (using long sequences of conditional logic), it blocks roughly half of its instruction addresses, and it injects its flag into the "freeze instruction" address most commonly used by the freezer bots. Hence if it gets the freezer befo
 
@COTO I do agree that the ease of insta-freezes makes it difficult to mount an effective defense.
 
@githubphagocyte No hurry... but now I'm suddenly realizing that perhaps I wasn't supposed to share my solution on the internet... ._.
 
2:01 AM
You can remove it if it's not too late...
Oh no I think it is too late.
 
Oh, well... pretends nothing happened
Sorry about that.
 
Is it for a competition? Will there be a problem with the question being posted here? Or your answer?
 
I guess it's a competition of sorts, which is why I'm worried about that, even though I see no explicit mention of not sharing anything...
 
@Will: I don't get the required sequence from your code... ?

The sequence is (more or less) linear in i, but your code generates a code that increases quadratically.
 
@COTO The "long chains of conditional logic" are actually very fast.
 
2:10 AM
@COTO it scales as n^2, as does the sum of the first n numbers.
 
Ah. I missed that it was a sum.

Carry on then. ;)
 
@COTO ah - your objection makes sense now :)
 
@PhiNotPi: A bot that "seeks out" other bots uses a minimum of two instructions to identify and attack, and a minimum of three instructions to rotate, detect, and attack. "Byzantine" moves an average of once every six instructions, hence any conditional sequences that take six instructions or more to fully execute have no better chance than baseline randomness of succeeding. Even three-instruction sequences have only a 50% chance of full connecting by the time they complete.
 
2:33 AM
@COTO I was referring to the fact that a series of If statements, such that one If statement redirects to another, are all executed on the same turn.
For example, look at the current leader Super Freeze: codegolf.stackexchange.com/a/36998/2867
If there is no opponent, that bot moves/rotates 9 out of every 11 turns. If there is an opponent directly in front of it, it attacks 8 out of 11 turns.
 
 
2 hours later…
4:41 AM
@PhiNotPi: For something that's basically assembly code, that's got to be the most counterintuitive rule ever devised by the human mind. :O

Thanks for letting me know about it, however. I'll wipe out "Byzantine" and rewrite a new bot that exploits the *ahem* "interesting" rule.
 
 
3 hours later…
7:25 AM
0
A: Sandbox for Proposed Challenges

professorfishDetect Duplicate Questions code-challenge natural-language Once upon a time, there was a golfing site. It had a problem: people would post similar or identical questions again and again. You have been chosen selected forced conscripted blackmailed requested to automate the process of deciding wh...

 
 
2 hours later…
9:09 AM
@COTO I don't see why this challenge should mimic assembly code, even if it does look like it. The fact is that instant conditionals make for more interesting gameplay
 
 
2 hours later…
11:27 AM
@overactor: I agree it makes the challenge more interesting. But the fact that it isn't explicitly mentioned in the OP is like failing to mention that 1+1=3 for the sake of the exercise. It flies in the face of reality.

Maybe I'm the only one who considers the concept so foreign. Other readers obviously managed to figure things out without an explicit warning.
 
hi
I was wondering if optimization questions are on topic here? What I have in mind is to pose a mathematical problem with a way to make data and for the winning criterion to be the smallest value of the objective function you can find
all things being equal this might favour C but all things are never equal :)
 
11:50 AM
0
Q: Make sandbox classified?

RealdeoI just saw the merged sandbox, and woah... I notice that in the OP post that the active challenge is classified into 3. King Of The Hill Codegolf Others Will it be wise if we make 3 sandbox? One sandbox for each type? So we have One sandbox full of KOTH. One sandbox full of codegolf and one ...

 
12:28 PM
0
Q: Click here to find out what this question is about

AnkoCode Golf question titles are frequently opaque. The front page (and Hot Network Questions) hence partially degrades to a list of clickable rectangles. When clicking, I more often think "WTF does that mean" than "This sounds like an interesting puzzle". Recent beauties, explained: If a progra...

 
12:46 PM
@felix yes, optimisation functions are generally on topic, usually tagged with or sometimes with if the goal is to optimise runtime in some way. make sure that the challenge can't be solved optimally though or it boils down to some tie-breaker.
 
I working on a spec for Code Bots 3.
Since Nathan Merrill already claimed Code Bots 2.
Does anyone have any suggestions for improvements?
I've decided to change the initial layout of the board to something like this:
..@....@....@....@.
@....@....@....@...
...@....@....@....@
.@....@....@....@..
....@....@....@....
..@....@....@....@.
@....@....@....@...
...@....@....@....@
In the first version, the bots were already lined up with each other. Now, they require more movement to get in a position to attack.
And I'm adding case-insensitivity.
I'm working on a way for bots to have a sense of "touch" so that they know when they are being attacked.
And line labels.
 
1:31 PM
eight bit values
each bit stores if there is a bot at a certain place
 
I was originally thinking just the 4 orthogonal directions for touch.
What do you think of a jump or goto statement: given a number N, it executes line #N and sets C to the value of N.
Or would that be too powerful?
It would allow a loop such as this to execute a command every turn:
If D (attack) (move)
Jump 0
 
@PhiNotPi that doesn't seem especially more powerful than what can be constructed already.
 
It's just more compact, which I like.
 
You can already have an if that checks if repair is needed and if not attacks or moves all in one turn, right?
@PhiNotPi yes I like the compactness. The lack of too much additional power means less reason to avoid implementing your suggestion.
 
1:47 PM
I am also trying to figure out a way to make repair a more viable option for defense.
Something that would tell the bot where injuries have occurred.
 
Something has just occurred to me and I have no idea if it would make a good challenge or even work. Could the bots have a simple neural net instead of code, and be able to influence individual nodes in the nets of nearby bots?
 
You would have to work out how the neural network functions.
 
Yes it would need to be simple enough to not put people off but complex enough that it wouldn't be completely broken by a single change to a single node.
I was thinking a fixed number of input nodes, internal nodes, and output nodes, but with the connection weights chosen by the contestant.
 
The problem is that there might not be much room for variation.
 
@PhiNotPi yes I think this might be too awkward to be a KotH.
If the network is large enough to be flexible enough for various different strategies, then it's probably going to be too large to program by hand, so it will just be an evolutionary contest which is fascinating in its own right but perhaps not as a KotH.
Unless the contest is to write an evolutionary algorithm that evolves a better contestant than your opponent's evolutionary algorithm can.
I started off thinking this probably wouldn't make a good challenge and I am leaning even more that way the more I think about it...
 
2:00 PM
@MartinBüttner Thanks very much.
what's the best way to add math to a question? It looks like mathjax isn't turned on here
 
@felix have you seen mathurl.com?
 
@githubphagocyte No! thanks
 
Should I attempt to make Code Bots 3 backwards compatible with Code Bots 1?
 
@PhiNotPi you mean so that Code Bots 1 contestants can be used as example bots?
 
yes
 
2:07 PM
ok another question about the level of math people can cope with :) If I use the word "Hessian" and give a link to en.wikipedia.org/wiki/Hessian_matrix is that too much math for codegolf people?
 
I would focus on whatever is best for Code Bots 3 rather than adding that restriction. If it happens to be back compatible then great - but I don't see a strong reason for working towards it.
 
okay
 
@felix people on this site range from zero maths to high level maths in various areas. So you definitely can't write a maths question that will be open to everyone, but most maths questions you could ask would mean something to at least one or two people on the site.
 
@githubphagocyte ok .. maybe you or other people could give me a hand making the question as open to as many people as possible
@githubphagocyte I mean most maths is simple once it is broken down into coding :)
 
I would expect some people to not even need the link to explain the Hessian, but your question will be open to more people if you add a brief explanation of the aspects relevant to your question in addition to a link. It's a lot easier to read a short description of a completely unfamiliar subject than an entire Wikipedia article about a completely unfamiliar subject
@felix are you familiar with the sandbox?
Working link to the sandbox
 
That's... not how code golf works.
 
@githubphagocyte thanks
 
@felix you're welcome. When you post in the sandbox the post appears as a link here in chat, so people can see that something needs feedback.
 
3:08 PM
@githubphagocyte ok thanks
 
3:47 PM
I am considering removing the ability to access opponent's variables.
The pros would include the fact that insta-freezes wouldn't work: you couldn't simply insert a command right where the opponent is going to execute next.
The cons could include the fact that you couldn't check to see which way an opponent is facing.
Looking at the current challenge, the use of *C is widespread.
There has to be a better way to reduce insta-freezes.
Something with increased ability to block.
 
4:25 PM
hello, i need a bit of help with my first KotH challenge, currently sandboxed at meta.codegolf.stackexchange.com/a/1965/16402
TL;DR: It's a turn-based business contest where you make money by transporting passengers
each turn, the competing program has to send some commands to the control program
and vice versa
is there any way i can accomplish this without having to invoke the competing programs once each turn?
(I haven't written the control program yet)
has someone used it yet?
(the spec is now complete, it's the control program that i need now, I'm thinking of using this as an excuse for me to learn python)
 
4:41 PM
@professorfish I don't know if the linked meta question with a library for interacting with persistent submissions is going to work out for you, but it would help the community if you used it and highlighted any problems with it. That way we can get it to a point where it is as useful as possible for future King of the Hills.
As being the first to test the framework is something of a sacrifice on your part, I think it's reasonable to ask for help with any bugs or missing features you find.
 
I would have used bash but it appears that it can only run one coproc at a time
here i have a control program and 4 players
 
I think keeping the contestant programs persistent makes more sense than invoking them every single turn. It makes it easier for programs to maintain state (assuming your rules don't require zero history). It also makes the whole thing run much faster.
 
My rules allow keeping history during a game and between games within a tournament
but the program is invoked each game
so external files are only needed to keep data between games
I think I'll try the python library
 
Sounds good
 
holy crap the collatz conjecture makes the Mandelbrot set?!!!
 
4:50 PM
Let me know if there's anything I can contribute to improving with the python library - it's something I'm hoping to use myself soon too
 
@cjfaure that does look startlingly similar to the mandelbrot set...
 
5:14 PM
It does look like there are lots of little mandelbrots hanging off of it.
@githubphagocyte What do you think of this idea for helping to reduce the effectiveness of insta-freezes?
When a Copy Var Var instruction is executed, the change is not made until the start of the next turn.
 
5:35 PM
@PhiNotPi I'm trying to picture whether that just shifts the problem
Could someone still copy one line ahead? Could someone still copy a value one less into their opponent's C?
If you're making a new version how much are you looking to change? Would you consider allowing vision independent of viewing direction, so all four adjacent squares are visible?
 
So, if you do Copy 7 C and your opponent reads the value of your C, they would get an incorrect value.
 
What would it change if the code was composed entirely of numbers so bots could read code as well as copying it, and potentially modify it at random rather than just moving around existing code?
Ah I see. I was thinking more in terms of overwriting opponent code, rather than an opponent reading your own changes to your own code
So the opponent would not know where to place a copied line to be sure of being executed next turn?
 
They would not be 100% sure that it would be executed next turn.
 
So this would only disadvantage them on turns where you happen to manually update C?
 
I think so. Something like incrementing C at the start of a turn only requires the opponent use *#*C+1
 
5:46 PM
It seems like a small improvement then. Perhaps as one of several improvements it could tip the balance towards more robust bots
 
Also, there would be the advantage of temp-blocking the variable (any changes made by the opponent will be undone).
 
undone or prevented? I'm not too up to date with all the changes to the original...
 
Here's my current idea:
Let's say the command I executed was Copy 7 C.
Then, my turn ends and C is incremented.
Then my opponent's turns all occur.
At the start of my next turn, C is set to 7 and my line 7 is executed.
 
So a current bot would see C overwritten with 7, and then incremented to 8, whereas under your new approach the bot would see C incremented to C+1, and then overwritten with 7.
You would effectively be introducing a new secret variable that no one can look at and is used as the source for C
 
6:20 PM
@githubphagocyte I guess that is one way to look at it.
(I also think there is increased usability when Copy 7 C actually makes the bot execute line 7).
 
so i tried rendering a Lorenz attractor, went pretty well I suppose
 
Although there is also the Jump instruction, which does something similar.
@cjfaure That looks pretty good.
 
@PhiNotPi Chaoscope is awesome ;D
 
I think simply waiting to do copy statements may be a bad idea, since there could be problems with stuff like Store 1 D.
 
@cjfaure you could probably fit some lorenz attractor code into the functions for the tweetable mathematical art question...
 
6:31 PM
@githubphagocyte yeah...
especially since my red function code won't actually do anything
i can just squish some #defines in there
and also in the green function, since it's just return BL(i,j)*0.5... :P
 
7:23 PM
I've started making the control program and map generator for my KotH:
4
A: Sandbox for Proposed Challenges

professorfishTransport Tycoon [control program WIP] king-of-the-hill game The specification is now complete; the control program will now be written Your task is to create an AI which builds a profitable transport network to carry passengers. In each game, the first entry to have $262,144 or more in cash wi...

it uses the library by @Ray
0
A: Interacting with persistent programs

RayPython 3.2+ This library currently only provides the controller. The clients(player bots) should use stdin/stdout to communicate with the controller. It uses Python 3's concurrent.futures library to implement the timeout controll. You can find it on this github repo. Features Collect players...

it's on github
 
Sounds like it needs some example contestants in a few different languages to test with
 
probably - but I wouldn't want to post the question on the main site until i've written the control program
i guess simple bots with no strategy will be enough for debugging
just a bot that tests all the features
 
7:37 PM
Yes that's what I mean - bots that might be the example bots once you post in main
Something I want to know is a good way of writing a bot so that it doesn't use up a lot of CPU time with just checking whether there's input while it is another bot's turn.
I'd ideally like to be able to just freeze bots until it's their turn again but in reading up on that it sounds like it's hard to do it in a cross-platform portable way.
 
8:36 PM
@cjfaure Not bad!
But is it tweetable? :)
 
The Grace Period on Traders to the Death will expire today.
And I haven't seen Nathan at all for the past two days.
 
Man, I wish that KOTH had taken off in a better way. Seemed like a good implementation of a stock exchange sim.
More realistic than the other one, at least.
 
There just weren't enough entries to get the market started.
 
i imagine it could be, the Chaoscope project file:
info {
	version "0.3.1"
	author "User4"
	date "31/08/2014"
}
attractor {
	type lorenz
	iterations 100000000
	parameters <1.42857142857143, 16.3636363636364, 0.38961038961039, 0.0625649350649351>
}
view {
	mode plasma
	width 2048
	height 2048
	scale 2.25597055321717
	model_scale 0.0520878696475682
	origin <0.283234770237873, -0.103871662344664, 16.4262809013319>
	translation <0.0226310516298164, 0.00913615398322091, 0>
	rotation <-0.683934354442726, 0.70518316127086, -0.186950549271852, 2.751804955801>
 
Sadly. I made the random bot one, and was going to extend it to a proper player, but it seemed like a wasted effort.
 
8:45 PM
One problem is that, without market activity, there's really no strategy involved other than "growing what you have the least of."
 
True. It was really hard for me to thing how I would trade.
A spectrum genetic algorithm (idk what that means in nuts and bolts) would be cool to develop
create a whole bunch of independent characters.
 
Perhaps the amount of trading can be increased by increasing the initial supply from 10 of each to 50 of each, so the bots will live 5 times longer.
 
Yeah, I though it weird that the scoring is primarily about avoiding death.
 
I think some types of KotH really benefit from a variety of different example bots to start with, so you're not working with a sparse ecosystem, which is less interesting
 
Like the discrete dog fighter. Man that was hard to code for. No idea what to do.
 
8:54 PM
The BF Bots and Code Bots both had really good numbers of entries.
 
BF was a very cool challenge. You guys prepared code bots very well too.
 
Do you think the limited code helped get more entries, since you can fire off entries more quickly?
 
I definitely like the use of a specialized language.
 
puts people on an equal playing field.
more or less.
 
Sometimes it takes a little bit to learn how the language works, but after that, it is easy to write whatever you want.
 
8:58 PM
0
A: Sandbox for Proposed Challenges

blutorangeStrange patterns on the moon For people who are curious, like to do research, and want to learn something new. This is a somewhat real-world example that isn't to hard to implement, but it may seem difficult because many people around here won't be familiar with the topic. That's why I chose ...

 
and @githubphagocyte for me, I like to do some research before going into a KOTH challenge, so I find example bots really helpful. It was with the BF one at least.
 
I'm thinking up example contestants for the KotH I'm working on. I think I'm going to include at least 3. Basic strategies that are easy to beat, but 3 different approaches so that the dynamics are interesting even before there are human contestants to plan for.
 
(Regarding CB3, was 24 lines enough lines?)
 
@PhiNotPi I wasn't involved so don't take me too seriously, but I'd love to see 256...
 
I'm writing up an example bot right now to demonstrate the newer features of the language.
 
9:04 PM
Although I think it could be really interesting with a much higher number of lines, I'm also aware that being able to see the whole program at a glance is part of the appeal.
 
I think the highest I'd be willing to do is 32.
 
If you're making the language more powerful in ways that allow condensing meaning into less code, you might even end up using less than 24 lines
 
I think I'll stick to 24, since I think some stuff can be condensed.
Although, most of the new features so far are for increased speed.
 
I was wondering about space constraints and time constraints, and how they are balanced. At the moment a line used by an if not only takes up a line of your limited space, but takes up time to jump past it or close a loop before reaching it. Could you have lines that do nothing except when used by an if? So they take up space but not time. For example, if you had such a line at line 3, then after line 2 is executed the line marker C would be incremented straight to 4
So line 3 doesn't waste a turn, neither by doing nothing for a turn nor by wasting a turn with the equivalent of a goto
You could prefix such lines with something, so they are treated like comment lines except when used by an if
 
9:33 PM
I have included a Jump instruction which combines the instant-execution of an If statement with the Copy Var C.
 
So it effectively takes zero time, but still takes up a line of space?
 
Basically, a combination like:
If D #3 #2
Jump 0
Move
Copy #4 *#E
Flag
Executes the If statement every turn.
Because the looping takes 0 time.
 
Impressive.
And you can make that if arbitrarily complex?
 
You can have the If chain with other Ifs, all of which are executed on the same turn.
The main rule is that you can't execute the same line twice in one turn.
 
My idea was along these lines (using your example for comparison):
If D #2 #1
\\ Move
\\ Copy #3 *#E
\\ Flag
 
9:38 PM
So the options don't count as lines, correct?
 
yes, so the next executable line after line 0 is line 0 again
So it will automatically be executed every turn without having to specify
It only makes a difference in terms of space, not time, since your jump is equivalent in time.
So if you can choose the available space when you set the question this may not be important
But it might be useful if you want to give very limited space but not require any space for jumping.
This doesn't allow for flow control though
Would there be any use for advanced copy commands?
For example, a swap command
 
So how it would work is that execution of an \\ line automatically sends execution to the line after it (and increments C), until it finds a line without \\ and executes it.
 
Or a reverse command that takes a start and end line
yes that's what I was thinking. Execution just hops to the next executable line
Or a rotate command that takes a start and end line
 
This is a good idea.
 
Thank you - which one?
 
9:44 PM
Well, just the general idea of allowing the bot to skip lines.
The jump statement would allow a faster version of this:
If D #1 #2
Copy 23 C
Copy 4 C
Copy 8 C
 
Thanks. I introduced copying ideas while we were still discussing the skipping lines idea so I got confused... :)
Twice as fast
 
It would be even faster:
If D #1 #2
Jump 0
Jump 5
Jump 9
I already have an idea for a more advanced copy command, code-named Copy2.
 
Does the target of Jump 5 get executed this turn as well?
I know it would if you reached Jump 5 during normal execution, but what about when Jump 5 is the if target?
 
Yes
 
So now an if can not only execute another line, but it can execute another line and leave C at that point, all in the same turn?
 
9:50 PM
Yes.
 
Although this makes bots much faster and therefore better able to defend themselves, presumably it also makes them able to attack much faster too?
 
I think it would increase both defense and attack speed. The main thing is that it allows for smarter bots.
 
I think tipping the balance towards intelligent defense might require more input - view of a wider area and perhaps more variables in which to store acquired knowledge
 
I currently have plans for an F variable which counts the number of adjacent bots.
 
sounds good
 
9:53 PM
Also, the Copy2 command will increase some defense.
 
Now you just have to work out how to communicate all this to people who didn't see CodeBots 1... :)
 
Instead of the copying being applied right after your turn, it is applied right before your next turn.
 
But I think in some ways it could end up easier to understand than the original
If you wanted to make things really messy you could introduce 3 argument commands
 
Which means that the new value of the variable is safe between turns.
 
For example, DelayCopy A B C
which takes the value in A and applies it to B but only after C turns have passed
Which in theory would allow for a bot to be completely overwritten as a new bot, but then re-emerge as the original bot up to 24 turns later as all the delayed copy commands kick in
Horribly messy but amusingly devious.
 
9:58 PM
The main benefit of DelayCopy would be in DelayCopy Var C so your opponents won't be able to predict the jump in your code and thus a Copy Line *#*C would not work.
 
That's one advantage.
It would also allow overwriting several lines at once, but writing them sequentially with decreasing delays so they all kick in on the same turn
 
Some other changes I plan include the addition of Line Labels and case-insensitivity.
 
This could be used to drop a block of code into an opponent with no warning, or to refresh a block of your own code so that it doesn't matter if it gets overwritten in the meantime before the delay ends
yes both those sound very useful
I think anything for preprocessing would be best written into the controller
Subtraction and constant multiplication?
 
Yes to subtraction. Maybe to multiplication.
I'm going to post a sandbox entry with my current progress. It doesn't include some of the things we just discussed.
 
10:19 PM
I wonder how different it will need to be to avoid being flagged as a duplicate.
 
I don't know.
 
That's what the sandbox is for... :)
 
I just put my current work in the sandbox.
It doesn't exactly have much of an introduction. That'll be added later.
 
All it needs for now is things people can comment on
no point making it polished if it might need amending
 
I improved the layout of the arena, in my opinion.
It used to be like this:
B...B...B...B...
..B...B...B...B.
B...B...B...B...
..B...B...B...B.
But now it is like this:
..@....@....@....@.
@....@....@....@...
...@....@....@....@
.@....@....@....@..
....@....@....@....
..@....@....@....@.
@....@....@....@...
...@....@....@....@
 
10:31 PM
0
A: Sandbox for Proposed Challenges

PhiNotPiCode Bots 3 This is a challenge based on the popular Code Bots ("What's wrong with public variables?") challenge. I made a few observations during the development of the original Code Bots: I had a literal ton of ideas and wouldn't stop harassing Nathan Merrill about them. Nathan Merrill alre...

 
 
1 hour later…
11:58 PM
I'm also working on a "Simulate a Quantum Circuit" challenge.
 

« first day (1310 days earlier)      last day (3535 days later) »