@Sp3000 well PPCG was just established back then... the early phases of a public beta... plus it was one of the first betas, I think... and it's a rather unusual SE... so I think it took some time to establish certain standards
Since you have 10 here's two suggestions: Group them into pairs and make people pick two pairs of optionals, or drop one of them, group into threes and make them pick a set of three
Then it's a matter of whether you can balance them
how do I distribute 1,2,4? if I put them in the same group, everyone will just flip a coin between 1 and 2 and ignore 4. if I put them into different groups, everyone will still pick 1,2,4
maybe I should drop both 3 and 4. then the scorings would naturally come in pairs. which makes picking 3 (out of 8) more interesting. because you have to implement at least two genuinely different ones.
@TheBestOne Not really. It's so far off competitive that there's no incentive. I had a go at one or two Java entries with on the order of 75 bytes, but one which is twice as long has far more possibilities, and then it's presumably tagged Java 8 because it's using features I've never heard of.
Game of Towns king-of-the-hill
Introduction
The game takes place in a small world with different towns. The rulers of the towns hate each other and would like to rule the world. The people are divided into two groups, warriors and lowborns. However, lowborns can raise to warriors. You are the r...
Count the pips in a pair of dice
Here are four photographs of a pair of randomly thrown dice (N.B.: click thumbnails for full-size images). From left to right, the numbers of pips shown by the two dice are 3, 9, 9 and 5. Can you program your computer to count the pips automatically?
The ch...
rice also had a factor of hardness that rice can overlap
so while the actual code and logic to solve the question is completely different, my point was more based on the same point you made for drawing flag/hat some time back
@Optimizer that makes it a completely different problem though. there you had to figure out where one rice ends and another begins. here, the pips are all clearly separated, but there are some you shouldn't count.
@Optimizer I would think flag and hat are closer in spirit than these two. but not too similar either. but in vector-graphics image generation there's only so much variation you can have, I think. so the trick for coming up with interesting new challenges there is just to find graphics which have interesting sorts of regularities to be exploited.
(it's even on the landing page of my profile, yeah :D)
Rough cops and robbers idea (needs some work though): "I bet you won't beat me!" We compile a list of all reasonably common languages used for golfing on PPCG and sort them by how well suited they are to golfing (either depending on how often they win, or what place they usually get).
cops can write a fixed-output program in any of the languages except the top language. then they choose one language that's *better* on that list and dare the robbers to write a shorter program in that language.
the main problem I see is compiling the list and that one would have to whitelist admissible languages
alternatively one could allow robbers to choose any language higher on the board
hm no, I still don't really like it... for languages towards the top of the board, robbers would have fewer choices, which gives those language an advantage again.
@PeterTaylor just read your meta post. that's quite a broad definition. that would also capture all branches of the code which cannot be executed, like an if(0){...}
or like actually pushing a useful string with some garbage and slicing off half of it
@Optimizer btw, can't you shorten your morse thing, if you use that huge number in the middle only once, and have one program reverse it before using it?
Some classes of question are made more interesting by banning comments. For example:
Polyglots: example
Some source layout questions: example 1, example 2
Others, such as this code-bowling question have special treatment of comments.
Many languages define delimiters for comments, but not all...
@PeterTaylor regarding your comment. my point is that I think your wording does cover that. "the essential quality is that it's a range of characters which doesn't affect execution"
@MartinBüttner The question was really motivated by one specific case, but I tried to generalise it slightly. The answer is only really intended to reply to the question, not to all possible generalisations of the question (of which there are many).
@PeterTaylor If it's just one specific case, it might have been better as simply an answer to the loophole post, along the lines of "Using strings a stand-in for (disallowed) comments"
@Manu btw, while I like starting with 3 towns, I don't think it'll help much in the way of mitigating bias from player order. I think you still should run multiple rounds.
I think you need to use template template syntax to pass a param whose type is a template dependant on another template like this:
template<template<class> class H, class S>
void f(const H<S> &value) {
}
Here, H is a type which is templated, but I wanted this function to deal with all speciali...
@MartinBüttner Having 3 towns since the beginning makes the game more interesting and leaves room for special strategies. Of course I will run several games and take the average :)
Python2 golf question: I have a 2d list (ie list of lists) called b. Values are always 0, 1 or 2. I want b to contain a 2d list that is the same except every 2 is replaced with -1. Is there a better way than b=eval(`b`.replace('2','-1'))? This isn't for a challenge on this site I'm just curious
it's always nice when you're trying to figure out which of two equivalent expressions to use and the end up having the same byte count. you get to choose the one you like :3
"Create a function called isSolved() that takes a 3*3 list of 0s, 1s or 2s representing a tic-tac-toe board. 0 == empty, 1 == X, 2 == O. Return 1 if X wins, 2 if O wins, 0 if it's draw or -1 if the game isn't over yet."
def isSolved(b):b=eval(`b`.replace('2','-1'));b=map(sum,b+zip(*b)+[[b[i][i*x-y]for i in 0,1,2]for x,y in(1,0),(-1,1)]);return 2if-3in b else 1if 3in b else-(0in b)
not too happy with how i got the diagonals but the site it's on isn't even about code golf so w/e
@MartinBüttner Quite a few people complained about that. In my mind, 0001 is a number, and 1 is a different number. I mean, if your bike lock combination was 0001, you couldn't just enter 1.
@Rainbolt @Geobits btw, the new weekly challenge round will start at some point today, and (provided someone else doesn't have a better idea), it might become a KotH. I thought you might be interested (and/or willing to help out with a controller).
This is the prompt
Poor ol' Freddie the Wonderdog is lost in a tunnel at NODE 0 (see diagram). He can move one node at a time in either direction, right or left, with equal probability. When Freddie hits node L2, however, a force of nature propels him instantaneously to node L4. He escapes the t...
@Rainbolt i think with "These numbers are never used for math!" they were trying to imply "don't make it a number type" because it's common wisdom to keep numbers you won't do math with (phone numbers, etc) in strings to avoid trouble. that is bullshit
I don't want to beat it to death, but both games seem like something I personally would be interested in writing a bot for. But that's because I like Java and Java is a good tool for the job.
@Rainbolt possibly. at least you'd have to wait between the two of them as long as you waited since wolf now. but even so, I think it wouldn't hurt to modify it a bit more than changing the objective.
i wish i knew enough programming languages to know which ones are good for what purposes. i go into literally any program thinking "python can do that!"
what is ruby good for? i tried to get into it a while ago but for some reason it felt like python to me. and the places where it didn't feel like python were worse imo
@undergroundmonorail web applications. and also it's a good stand-in for python if you just wanna script something quickly (if it doesn't have to be fast). it feels a bit less cumbersome than Python to me
@undergroundmonorail I find not having a ternary operator, not having symbols for logic operators, and being forced to indent more cumbersome than the opposite ;)
@MartinBüttner this is just conjecture, but i think most people are going to like golfing in the language thats their favourite normally. i know for me that golfing in python is such a joy. all its subtle quirks are second nature to me. i'm comfortable. it's almost... intimate? wow this got weird i'm stopping here
@Optimizer sure, i'm not saying "this exists so your point is invalid". just that "if you would like to use python but can't get over the indentation, here's something that might interst you"
@MartinBüttner b if a else c is pretty much a ? b : c. your points are solid though, they don't bother me but i can see where you're coming from
@githubphagocyte What I'm doing now is assigning a subscore to how well my planes seem to be positioned against each possible opponent and then multiply that subscore by the likelihood of the opponent making that move
If it's completely perfect it probably doesn't matter how it's written, but if it's anything less than perfect it will need to be human readable for updates