« first day (1378 days earlier)      last day (3761 days later) » 

00:11
I give up. I don't get any of these.
whistles
(trying to go for shortest Python submission because I know Python won't win anyway ;) )
I don't even get the C++ ones :(
Maybe I'll write another cop.
@xnor I like your new one
thanks!
00:28
This should be easy for you guys:
0
A: Unscramble the Source Code

hosch250Python 3, 46 Program ""''''((()))*01==bbffiiillnnnooooppprrrrrttt Plus two newlines. Output '(otlotb)'

Have fun!
Hmmmm I can only fit print(range is range) in
Oh, you only gave 6 spaces :/
@hosch250 This is probably unintended, but is something like

print("'otlotb'")
bffiilnnoopprrrr01='((()))*='

okay?
I think you need to move the brackets into the string
'(otlotb)'
Oh right
But you get my point, right? :P
:P
I don't think this will work because of (), but one of the lines in xnor's scramble might be something like isinstance(str,type)
00:43
That one needs commas but i was thinking something like that
Woop I think I got one
... wait no
Nevermind :P
hrm
int and str gives str...
not sure if that helps though...
Oh this could be a single print in a for loop...
Could be, but how would you print by newlines without *?
You don't need to
Each print will go to a newline
for i in dir():print('hello') prints hello 6 times on newlines
Hm? I thought you meant a list comprehension, because there's no colon for a standard loop
Oh shoot
I'm dumb
XD
00:52
It's a good idea though, only problem is

>>> print(set is set for a in range(3))
<generator object <genexpr> at 0x02B5E2B0>
ooooh
add list() around the generator
ack no l...
wait I'm blind that could work...
Yeah that could :P
Now how to get a list of length 3... since I can't do range(3)
True
True
True
True
True
True

lol
:P
maybe make a sting with repr(some_builtin)?
then chop it?
Sp3000, just use a 3 character string like str(int)
00:58
That gives <class int>
tried already :(
Oh, nvmd
That could be a good idea though
e.g. str(map is int)
True, False are both too long though
len(str(int).split()) gives 2 and uses way too many brackets...
And a dot
right :/
01:01
I just (almost) finished a CPU design in Logisim
Actually, nevermind, none of you were the people I was having that conversation with.
By the way, thanks to all of the people who are maintaining the leaderboard thing.
@Sp3000 Well, it is OK according to the rules of the challenge.
Hmmm :/
Definitely not what I planned.
Giving all the letters necessary for the string makes it a bit simple though. Need to remember that or, =, " and # can all be used as comments practically
SquemishOssifrage thought he cracked it.
>>> print"('otlotb')"or'(())*01==bffiilnnopprrr'
SyntaxError: invalid syntax
>>> print("('otlotb')")or'()*01==bffiilnnopprrr'
('otlotb')
'()*01==bffiilnnopprrr'
>>>
He didn't though. His is the first solution, and the second doesn't work either.
01:09
o_O
So, as you can see, or doesn't work as a comment.
Well
In a file you wouldn't see the second line
That's just because print returns None
OK, let me test.
Try not print("a") or abc
(the not print returns True)
01:11
OK, it works in a file.
Yeah that's where it's meant to work, right? :)
Well, in a file, his solution will work if he just moves the parenthesis.
And yes, it is supposed to work in a file.
His solution is definitely not what I meant, though.
Yeah :/ I cbf posting because of that
Bet someone else will though
Also I have an idea for xnor's but one uses too many o's and the other uses too many spaces
Hmm.
I noticed that if you remove a while, it mostly has an even number of characters.
I didn't count the print()'s
I just took the cracking tool out of my question.
I don't know why somebody added in.
01:16
Was it an anagram verifier?
I honestly don't know.
Oh it sorts what you type I see
Think I'll give xnor's a break, oct(True) or oct(False) returns a 3 char string, but there's not enough o's or spaces to get rid of the remaining letters
No b I think, but would have the same problem
(the spaces part)
yeah you're right
01:21
But yeah something like list(print(set is set)for a in oct(not map))
But extra letters
I decided to put the anagram verifier back in the question.
Ooh
We can use a newline instead of a space
the () make it ok
list(print(range is range)for i in oct(print is
print))
Tricky...
01:28
I think that gives 2 more "spaces" if that helps you
... 1 space short :/
Which one are you working on, and what do you have?
list(print(set is
set)for i in oct(chr is
map and aaeeeeegginnnpprrrrrvwy))
7
A: Unscramble the Source Code

xnorPython 3 (74) Python just wasn't the same after being re-educated by Big Brother. Input: print(war is peace) print(freedom is slavery) print(ignorance is strength) There are two newlines at the end of lines 1 and 2. Output: True True True Note that each True is in its own line.

lol that and trick again :)
OK, thanks.
01:33
;) short circuit comments, short circuit comments everywhere
So you are one space short?
Yeah :/
Solved.
list( print(set is
Put a space before print.
I think he has one too many
No I mean, I've got 1 space too many
01:34
not one too few
Oh, Ok.
clode the paren of oct after map, then put the and afterwards
saves a space
That won't short circuit though, right?
I closed both parens:
>>>
True
True
True
Traceback (most recent call last):
  File "C:\Users\Abraham\Desktop\t.py", line 3, in <module>
    map))and aaeeeeegginnnpprrrrrvwy
NameError: name 'aaeeeeegginnnpprrrrrvwy' is not defined
>>>
01:38
Oh, change the and to an or and move it to the other condition maybe?
Wait no
the print?
print(...)and whatever?
Woop got it :)
Nice.
congrats, guys!
list(print(set is
set)and aaeeeeegginnnpprrrrrvwy for i in oct(chr is
map))
01:40
Are you all on Python 3?
OK.
There is only one more Python that isn't Sp3000's.
I don't get any of them :(
my solution was similar but used no short-circuiting
so no and, no or
:P Thought so, but I didn't want to sit there anagramming all the builtins
01:42
actually, there's another way to dump characters...
Haha when I saw Sp3000 use that i was sure you had done it too
As a callback to your other answer
Guess I was wrong :P
It was just the first thing I thought of :P
i was going to but i ran out of letters for and/or when i tried
i'm impressed you guys figured out how to reuse print so fast
I was going to use that in another problem yesterday
But then I figured I'd already had too many posted for now :P
SquemishOssifrage removed his answer to my post.
I wonder why? It would have worked if he had simply moved one set of () from the waste to around the print.
01:47
@hosch250 Here's a hint for one of the other Pythons: try: from future import braces except SyntaxError: ...
That's as far as I got though
The print reuse things was kind of a fluke.
Oh has that one been cracked already
Ahaha well when Fry mentioned for loops I immediately thought list comps, so that was a big help :P
i hadn't considered using any to force an evaluation; i thought it had to be list
which uses more valuable letters
Yeah I think we first had list
But list implicitly evaluates to true, so I couldn't stick and after it :P
01:51
ah, yes, all the o's are taken
so you can't do or
for <blargh> in oct() would clearly have been the better idea XD
Nice
02:04
I'm wasting my time on the cops/robbers.
I've lost a bunch of time, as 2 rep points besides.
My C++ solution had a problem.
BTW, did you know the rivers answer is tied with for the most upvotes beyond one solution?
The winning solution was really good, but was swept out of the water by someone else's answer.
I got 10 for that.
Ooops, missed page two. The second winner (7) was a smiley.
I just found a bug in SO.
If I respond to a notification (rep change, comment notice), go to another page, then scroll back, I get the notification again.
OK. Glad there are a few people here. I have an algorithm question.
What?
I'll type it up and then post it all at once.
brb
02:29
Hey everybody, check out my online pyth compiler!
Woo
You should totally turn it into a stacksnippet :P (I tried but gave up)
Stacksnippets require javascipt, right? I don't know javascript.
Aww :(
Neither tbh, but I tried :P
I gave up on parsing though
I love parsing.
Input parsing and error handling are my favorites.
@hosch250 @___o
02:32
What is that about?
@COTO
You liking parsing.
What does the smiley mean?
I should offload my parsing code projects to you. :D
It means I just went bugeyed.
I just parsed input (no error handling required) in python:
t=input().split(':')
Input is hour:minute
That is baby.
I asked this question once.
3
Q: Validate input according to flags and input masks

hosch250This challenge challenges you to write a function that will take as its argument an array that specifies the types of input, an optional prompt, and a verification key; inputs and validates the values; and returns them. Input types: b - Boolean values. c - Characters. i - Integer values,...

Yeah, I know how to do it. I just never thought anybody could "love" to do it.
02:34
Well, my answer is the only one.
btw @isaacg You should make the boxes <textarea>s so they can be expanded
OK, here goes...
Suppose you have a 2D rectangular grid. Coordinates are integers. Each cell (point) on this grid contains either a black pixel or a white pixel.
Through some procedure (the details are unimportant), you compute a vector datum for each cell. The vector basically points to "where the cell contents want to go". The angle of the vector indicates direction, the magnitude of the vector indicates magnitude of desire, with 1.0 meaning the contents really want to go in the indicated direction, and 0.0 meaning the contents could care less.
There is also a "viscosity factor", E, ranging from 0.0 to 1.0, that applies to all cells. A factor of 0.0 means that cell contents move about freely, entirely driven by their "desire" vectors. A factor of 1.0 means that contents rarely, if ever, move.
Now suppose you're iterating over many timesteps. In each timestep, the algorithm computes the "desire" vectors for all cells, "resolves" (somehow) the ideal way to get contents to the next timestep, and then updates the cells by moving their (black or white) contents into their target cells. Basically, therefore, you're just moving black and white pixels around like the particles of an incompressible fluid.
My question is: What is a cheap, dirty, and (above all) simple-to-program way of "resolving" the destination of each cell at the end of a timestep?
There must be some randomness in the diffusion. That is, the algorithm that resolves how to best update the cells over one timestep should deliberately not seek the global optimum to the problem. There should always be a bit of randomness. Ideally, the randomness would be controllable using a normalized parameter, where 0.0 indicated pure random diffusion (subject to viscosity) and 1.0 indicated pure "desire"-driven flows (subject to viscosity).
It seems to me that there's a dynamic programming solution in there somewhere, but that seems like ridiculous overkill, and I want to code this thing in an hour or two.
Any suggestions?
> could care less
ಠ_ಠ
I'm sorry, this alone was enough to distract me from the entirety of the rest of the wall of text :P
Pyth is a one-line language.
@Sp3000
I'll make the input a test area, though
text area
@isaacg I was just thinking, on the offchance, maybe someone might use Pyth for a ridiculously difficult problem
02:41
@Doorknob Right. I forgot that some people don't like that expression. Try to ignore it. ;)
And having it wrap in a textarea might be easier to see than offscreen in an input box
@Sp3000 You misunderstand me. Pyth enforces one-line-ness, newline is a comment character
OK, text area sounds reasonable then
I'm not saying newlines, I mean wrapping
Gotcha
@COTO I don't mind the expression. It's just that it's strangely and incredibly annoying to me when people misuse it. ;) (If you could care less, that means you do care!)
02:44
I know why people object to it. But you overlook the fact that it's an expression, like "fat chance". You don't interpret it literally.
@COTO When you say "viscosity factor" is that like magnitude of velocity or...?
No, it's the tendency for the cell contents to remain sedentary. So if it's zero, even the tiniest desire for cell contents to migrate will cause them to migrate. If it's one, only the strongest possible desire will cause any movement in cell contents.
I'm pretty confused sorry, so it is possible for two black cells to want to move to the same cell? What happens if they do?
@Sp3000 That's what "resolving" is all about. You have to figure out an elegant way of "optimally" sorting out all of the conflicting desires.
Ah k. So something like (vector of desires) dot product (vector of 0 if white else black)? Maybe
And then random based off that normalised
02:52
The cell contents don't actually matter. Just imagine them to be a packet of data with an associated "here is where I want to go" vector.
Hmm not sure then, sorry :(
03:10
@isaacg The online compiler doesn't seem to like multi-line statements(i.e. instead of it being ignored, it throws a syntax error) But this might finally get more people to try Pyth, which is great :)
Hm, I'll try to fix that issue, shouldn't be hard.
I think it throws on the newline char..?
I really like the byte counter, but a QoL improvement might be to put the "most recent code" back in the code block after running
Hm - not sure how to do the later. The newline issue is fixed, though.
Great :) I also love the debug option
It's in the command line version too, in case you hadn't seen that.
Most recent code in the code block implemented.
03:47
Yeah I had used it in the command line one, which is why I was glad to see it :) Also, that was fast :)
04:26
Ok, the interpreter made me so excited, I added another scramble! (let someone else try isaacg ;p )
0
A: Unscramble the Source Code

FryAmTheEggmanPyth - 35 In the spirit of @MartinBüttner: Code "Programming Puzzles and Code Golf" Output 4.459431618637297 Try to decode it online here.

 
2 hours later…
06:26
My Python is the winning solution for now: codegolf.stackexchange.com/questions/41193/…
Until the GolfScripters come along.
 
2 hours later…
08:00
Sometimes I wonder whether I should just come up with my own golfing language. Sounds like fun.
08:20
hi
Hello
how things?
I was wondering about a couple of things
first.. have you taken a look at codegolf.stackexchange.com/questions/40831/… ?
The challenge, yes - what about it?
oh right
so I was thinking that it might be more fun/challenging to put one dot on each grain
what do you think?
this would exclude some of the methods used currently for the counting challenge, for example
08:35
Would be cool, but would also be about 20 times harder :P
well yes.. I am all about making challenges on the internet difficult :)
I think if you make it too difficult you don't get answers though :( codegolf.stackexchange.com/questions/40343/…
But who knows, might work out
So is this a separate challenge post?
you are right of coursel
let me read your questiob
@Sp3000 yes
but.. actually I have a problem with it. I don't really like just giving 10 examples and scoring on that
as you can cheat basically
kk - well if you can write up the spec for it, then try putting it up on the sandbox and see how it goes
If you can somehow write a program to generate a picture, that'd be the best way of solving that
Might be hard though
so ideally we would have a "rice generating" program first
exactly
so maybe that could be a challenge :)
08:38
Doesn't have to be rice though, in that case does it?
sorry I didn't understand. What doesn't have to be right?
I just read your question.. it's nice and not too hard
I am not sure why people aren't answering it
maybe a bounty?
(corrected to rice)
Ahaha maybe in a month or two when I have more time
It's probably a bit tricky due to floating point precision
it only takes 1 second to click "bounty" :)
why wait a month or two?
But what I mean is, it does have to be rice in that case does it? You could probably simplify it to overlapping ellipses
(Exams coming up this month so I'll have more time after a month or two)
@Sp3000 oh I see.. the problem is that it might seem less cool to people if the picture is artifical
so I was wondering about sensible ways of distorting the images we have
for example rotating, scaling
what sort of exams have you got coming up?
08:43
Maths and programming ones. University.
Going to have to brush up on a bit of Haskell
aha.. and English uni too :)
an English...
Rotating/scaling are the obvious ones
You can add a bit of shadow too
Or have a bit of noise
@Sp3000 but I can't see how to get rotating to work either. The problem is that the simplest way is to rotate the whole square. They you can just rotate it back easily
(just throwing ideas out there)
Then you can...
ideas are good.. I haven't managed to see how any idea would work yet
do you see the problem with rotating?
08:44
An ellipse is defined by two foci, so you can do dist(point, focus1) + dist(point, focus2) < constant
If your foci aren't on the same horizontal/vertical line, then it'll be a diagonal ellipse
you mean for drawing artificial rice?
Yeah, as an example
I mean, once you extract out similar-looking colours all you have left looks something like a bunch of ellipses right? Is what I was thinking
sure.. I just don't want to do that as the whole challenge of the rice thing is the natural look of the images
the reason the rice challenge is hard is because natural images aren't quite as simple as you might hope
imho
Alternatively you could have a stock library of individual rice bits on a transparent background
@Sp3000 interesting
08:47
Unless you plan or taking rice pictures whenever you need more test data?
I need to be able to make them touch
What's hard about that?
I was more hoping we could make rotating, scaling ,adding noise work :)
@Sp3000 I think part of what makes the challenge hard is that they overlap slightly when they touch
take a look at i.sstatic.net/eXCGt.jpg
can you think of any way of doing rotation that isn't easy to just unrotate?
are you 1st year CS?
3rd :P
oh! I am surprised you are doing maths and programming exams!
08:49
Hmm if they're overlapping then I guess it wouldn't be easy to unrotate
So what, just to get this straight - are you planning on manipulating images to taking photos?
@Sp3000 if you rotate the whole square you can just look at the edges of the square can't you?
I don't want to take any pictures!
I want to be able to generate lots of images
Hmm I guess my best idea would probably still be stock library of transparent background rice images then, and when you place them you can check if any pixels overlap, and roll a dice to decide whether to put it there
interesting
"a die" :)
two dice :P
08:53
Well that's just so you don't always end up with a contiguous blob, with possibly some stray grains
now I am wondering about how hard it is to render a random pile of grains of rice :)
but I am not sure there is a stackexchange for that sort of question
@FryAmTheEggman That's interesting. The @MartinBüttner is highlighted in the onebox. (It didn't ping me though.)
Well if you have that stock library, then that shouldn't be too hard. The shadows might look wrong though
@Sp3000 right.. I was thinking something more adventurous now (not for this challenge) where the grains can be on top of each other
XD good luck with that (that is adventurous)
08:57
@Sp3000 As I say.. I think that is out of scope here :)
That's just impossible, even for humans
hm.. is there a stackexchange for computer graphics?
@So
@Sp3000 what is impossible for human beings?
@Sp3000 I bet a good painter could do it :)
That pic :P
No I mean, counting how many are in the pic
Oh I see... yes it is a little tricky :)
@user2179021 there's a proposal in area 51, but there's DSP.SE which might be what you're looking for
08:59
@MartinBüttner Thanks... I imagine it will annoy them if I ask how to render vvrsaustralia.com.au/wp-content/uploads/2013/01/… :)
oh, right, I thought you wanted a place to ask about how to count, not generate
in my experience, some *.se like interesting and poorly thought through questions.... and some don;t :)
in that case, yeah, you'd have to wait for the CG proposal to go through
@MartinBüttner first I need to generate before I can count :)

« first day (1378 days earlier)      last day (3761 days later) »