« first day (1620 days earlier)      last day (3216 days later) » 
00:00 - 15:0015:00 - 23:00

3:07 PM
its already that
 
3:24 PM
@Vioz- Strings are char arrays. ['a] and "a" both push the same thing. What are you trying to do?
 
@Vioz- .zfill(3) -> "%03d"% ?
 
3:42 PM
@Optimizer That would be rather of them, don't you think?
 
@Dennis I was trying to do the bf->unary challenge, just couldn't figure out how to iterate over a string
@Sp3000 bin returns a string, not an int, so that doesn't seem to work
 
@Vioz- just like you iterate over any array
 
Oh right, bin... surely keeping track of the numbers as you go would be shorter though? Rather than converting to binary and back
Hmmm
 
Hmm is right.
 
4:00 PM
@Vioz- Ahaha I meant avoiding bin altogether, but okay
 
My brain is not in a state where I can think of avoiding bin :P
 
:P
 
4 more to go.
 
@Vioz- You should try oct for the second program. There's two things you need to be careful of though
 
4:18 PM
What should I be careful of exactly? :P The only thing I noticed is that if it's too long that an L is appended
 
I got a CJam question that sounds similar to the one from Vioz above, if anybody is up for it: I have a string on the stack, and want to unwrap it so that each character becomes a separate stack entry. The ~ does that for regular arrays, but it appears like it does not apply to strings. Found nothing below about 4 characters so far.
 
Yeah that and the leadng zero
 
I actually have to chop off the leading 01
 
Or that :P
@RetoKoradi I asked the same thing today and Dennis answered - try scrolling up?
 
I'm trying to figure out how to do this, since I can't just do [2:-1], and replace/ if c!="L" will kill the byte count
 
4:22 PM
if"L"!=c isn't too bad considering the gain from using oct I think
Sorry, "L">c
 
I guess, it gets me down to 64 for that
I think I could use oct to save some bytes in the first one too
 
Maybe :P
 
@Vioz- Are you still working on a CJam solution? If not, I'll post mine.
 
for ?
 
@Dennis No, go ahead :)
And oct got me down to 62 bytes right away, I think I can toy with this more
 
4:25 PM
@Sp3000 Found it, thanks. Unfortunately that's not any shorter than what I already had.
 
Ah yeah, one downside to overloading I guess
 
This question has a reopen vote but needs a little more clarification. If anyone wants to look and see if I've missed anything that needs to be clarified in my comments that would be great.
1
Q: Insta-Name... Just Add Coder!

jman294In the English language, a surefire way to make a pronounceable nonsense letter combination is to make it entirely out of consonant- vowel pairs, e. g., Wu ko pa ha, or, Me fa ro. The challenge is to code a program that will, with the user specifying the number of letters in the name, create a ra...

 
The ~ operator actually gives an error for a string. Would be nice if it would just unwrap, like it does for other arrays.
 
Otherwise I'm worried about it being reopened too early
 
Well, I think it tries to interpret the string.
 
4:28 PM
Eval's more useful though
 
Yes, that functionality is certainly useful.
 
if only Python 2 could implicitly convert to strings, I'd have a 55 byte solution for the first program
 
@RetoKoradi that's quite an unusual thing to do, but there is {}/
what did you have in 4 chars?
 
@Vioz- I have 53 by doing something like that :P (converting ints to strings)
 
~ on strings does eval
 
4:31 PM
Gah!
 
Not posting though
 
Well now I need to figure out how to get 62+2 bytes down to 53
:P
 
Well... 53+2 by your scoring (where's the +2 bytes for quotes thing from anyway?)
 
Since the input needs to be enclosed in quotes, i.e. adding to the input based on the spec, I added bytes to it
 
Hmm I wonder if there's a meta on this sort of thing - I don't think I've seen anyone else do this so I'm curious
 
4:35 PM
How did B***nf**k get into HNQ uncensored??
Should the title be edited before we get the site into trouble?
10
Q: Brainfuck to Unary and Back

MaltysenA language that is very useful in restricted source and other such challenges is Unary, a brainfuck derivative in which programs are written in with only one character. Your job is to write a program to convert programs from brainfuck to unary and a program to do the opposite, both programs in th...

 
and the tag too
but I guess, its okay since the mods are away :P
We can blame it on them being away :P
 
lol no that's more reason to look after things - or we won't be trusted on our own again...
 
I thought they patched it after last time this happened
 
I guess their mods are away too
 
Does the tag show up anywhere outside this site? I've just edited the uc out of the title for now.
I've left the tag as it is (it's an existing tag with 34 questions)
 
4:42 PM
@Vioz- int(...,8) can work without the leading zero
 
Oh, cool!
Now to figure out how the hell 53 is possible.. :P
 
@Vioz- for what?
 
For the BF -> Unary thing, @Sp3000 said he figured out how to do it in 53
 
Dennis did it in 35
 
Well, specifically for the first half and in Python ;)
 
4:45 PM
ah, python
 
Has anyone played beast quest in here ?
 
Hmm it'd have been cool if keeping the leading zero and doing just int() worked, but I can see why they only made it work for eval (which doesn't save)
 
I think I'm going to stop trying to improve, this is hurting my head too much :P
 
@aditsu I first used 1/~, which gives me each character on the stack, but as one-letter string. I only really needed a character for one of them, so I used c to convert that one from one-character string to character.
 
@RetoKoradi why not get the character directly from the string? which one do you need?
 
4:55 PM
@aditsu The string has 5 characters. I need all of them. For the first 4, I don't care if they are single-character strings or characters. The 5th is actually a number, so I need to subtract '0 from it to get a numerical value.
 
well, )~ can give you the number, not sure what you want to do with the other 4
 
yeah, I thought of that. the next step is that I want to replicate the 4th character by the number I get from the 5th. if I pop out just the number, I still have to separate the rest. and would have to shuffle things around on the stack because the number is now on top
{}/ does save one character compared to what I had
 
I see
 
It's this thing here: codegolf.stackexchange.com/a/52717/32852. Not very competitive anyway, but I wanted to see how short I can make it while sticking with more or less my original idea.
 
either way, you can use ~ to convert a numeric string or character to number
no need to convert to character and subtract '0
 
5:08 PM
the problem is that one of the values is 11, and I wanted to use only one character in the string for it, because all other corresponding values are below 10
so that one is a ; in the string, which is 11 if you subtract '0
 
You can eval B
 
yes, use the B character :)
 
btw {}/ is neat :P just saying
 
it's from golfscript :p
 
oh! I did not know that eval would evaluate B as a hex number. that will help
 
5:10 PM
no, it evaluates B as a variable; default value is 11
 
It's more like ~ evals actual code
 
i see, yes, that makes sense. i had noticed that the default values of A-F match their hex value
 
It's called good language design :) (and it makes things easy to remember)
 
thanks :)
 
yes. thanks for all the help. i have to get to work, will update the answer tonight. i should at least get close to 50 bytes. unfortunately you found a much better approach, @Sp3000 ;)
 
5:14 PM
Seriously though, it's one thing CJam has over Pyth :P
Ahaha no worries, I'm still learning too :)
 
5:29 PM
@Sparr Well, it is a rather strange idea. By the way, you can use non-ASCII characters in Python by adding, e.g., the line # -*- coding: latin-1 -*- after the shebang.
 
5:40 PM
I think that wasn't valid in python 2.2 and earlier? I'm a bit fuzzy on the cutoff.
 
No idea. I just know it works in my version. :P
 
6:32 PM
I've wished for this feature several times
does anybody know of a way to find global javascript variables or functions that aren't built in
in chrome console
 
If I have an idea for a scoring method/challenge type, should I
A. Post it as an answer to an existing meta question
B. Post it as a new meta question
C. Just post a new challenge in the sandbox and see if people like it
 
sandbox IMO
otherwise, A
if you don't have a challenge attached to the challenge type, then A
 
I have a challenge in the sandbox that I'd like to apply it to, but it isn't ready yet.
 
7:03 PM
Man, that Australian flag was a pain to get right...
And I think the stars are still not properly golfed.
 
I went with A, and posted it as an answer on meta.
0
A: Fair size comparison across languages with different source alphabets

trichoplaxKeep the existing approach Encourage new challenge types / scoring methods for variety and balance I don't think a general approach to making language differences fair will work - different languages have different advantages that vary from question to question. However, having a variety of sco...

Someone needs to put a stop to the flag questions before things get out of hand and we have the Welsh or Brazillian flags.
Answers will be pages long...
 
Brazilian should be fairly simple as long as the resolution is low enough. The Welsh...
 
Well even the Welsh is simple if you put the resolution low enough... :P
 
7:18 PM
OK, clarifying. As long as ORDEM E PROGRESSO is small enough to be spelled out with actual letters, the Brazilian should be doable.
 
Ah - fair point
 
all the flags go with my "we have too many ascii art challenges lately" observation
 
7:35 PM
I can see why the flag questions are popular to ask, at least. Fairly easy to just Google a flag and make an ASCII representation
Personally, I think they'd do better as popularity contests.
 
They wouldn't stay open for long if they were pop contests.
 
As code-golfs they end up being fairly repetitive, at least with a pop contest there would people trying for a creative answer.
 
Aren't most ascii art code-golfs fairly repetetive?
 
@Vioz- I'm not sure I'm understanding what you're going for. Do you propose a kolmogorov-complexity question as a pop contest?
 
@Dennis I must be delirious from work, not sure what I was on about
 
7:50 PM
@BrainSteel I've solved more than 20 ASCII art challenges using the same language and I'm still not bored. I've golfed 4 flags in the last week and each required a different approach to encode the pattern.
 
0
Q: Balancing Words

Vioz-Balancing Words This challenge was posted on the DailyProgrammer subreddit, and I figured it would be a great candidate for a code golf challenge. Determining if a letter balances is based on its distance from the point of balance, and the letter's value. The value of a letter can be determined ...

 
8:40 PM
optimal answer to every flag question: ⚐ (assuming the resolution is low enough)
5
 
 
2 hours later…
10:57 PM
@aditsu .
 
lol
 
00:00 - 15:0015:00 - 23:00

« first day (1620 days earlier)      last day (3216 days later) »