Sandbox Note: Haven't thought of a title
In this challenge, you will be writing programs that when directly appended to the previous program, will output the associated number, if that program is run directly, it should output the next program in the sequence
Example
Let's say my programs ...
Pyth, 23 bytes
VO6"*click*" w;"*BANG!*
Really simple. A random number of iterations 0 - 5 display click and request a line of input, followed by a bang at the end.
+3 bytes yeeeeeees
If only I had remembered to commit when I was done, I could have beaten pyth...
What general tips do you have for golfing in Prolog? I am looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Prolog (e.g. one letter variables is not specific to Prolog to reduce the size of programs).
Please indicate in your tips if it...
Let's assume Christmas is over.
Yes, how much, not how many...
As we all know, a large present is far better than a small one. Therefore, the value of the presents should always be measured in total volume, not number of presents, weight or even combined price.
As it's frowned upon to compa...
It's interesting how no matter how quiet the chat itself is, there are always PPCG people working on questions somewhere (see above). Warms my heart a bit that PPCG is always there to respond to a question no matter what time it is or how dumb the question is.
Due to some unfortunate accident during coding you are now teleported and stranded on an alien planet. You really hope that the locals will be helpful and point to the general direction of how to get home, but before trying to talk to them you want to decipher their language. Fortunately it looks...
@AndréMuta The probability of an overlap is the same as the probability of the second point lying within a circle of size r1+r2 centered on the first point
Well, Maltysen asked if the entire second circle should be inside it, just the center or, as you originally stated, that the second circle "overlaps the first circle"
Convert to the xkcd date format
code-golfdateascii-art
In his xkcd about the ISO 8601 standard date format Randall snuck in a rather curious alternative notation:
The large numbers are all the digits that appear in the current date, and the small numbers are 1-based indices of the occurrence...
A Caesar shift is probably something we're all familiar with.
(You might be even doing it as a homework task. If so, please don't copy these answers, your teacher almost certainly doesn't want anything like the answers here.)
Just in case you aren't, a Caesar shift is a very simple form of cip...
Marbelous, 21 bytes
}0 # takes one input n
-- # decrements n
?? # random value from range 0..n (inclusive)
=0?0 # push right if not equal to 0, fall through otherwise | convert to zero
++ # increment | no-op
{0// # output | push left
I've taken 0 to be falsey and 1 to be truthy, ...
Inverse Champernowne Substrings
The Champernowne Constant is the irrational number 0.1234567891011... extending ad infinum.
We've done a question about it before. But this question is about its reciprocal, known as the Inverse Champernowne Constant. This is approximately 8.10000007.
Given a ...
I was thinking about a challenge on wrapping time.
I am a member here for 33 days now. I would have expected for the date to wrap to 1 month.
The challenge would be to write a code to do that, given a joining date.
Round to the nearest full unit.
Example:
In: 2015-12-10
Out: 8 Days
In: 2015-...
@StewieGriffin You know, the title of your latest challenge is making my inner grammar pedant really yell at me, no matter how many times I tell myself it's technically not wrong. :P
(well, I guess it should be "how much present"...)
Random Walk Printer
Draw a program that will write to STDOUT every m miliseconds and n times a string that contains a dot . at the location of the walker.
A random walk is a mathematical formalization of a path that consists of a succession of random steps (wiki), such that every new step will ...
"Counter" is a language I've created for the purpose of this question.
Rules
Commands are read from left to right from the first character.
A program is written in exactly one line.
Data is stored in counters. At the start, there is exactly one counter. More can be created and deleted.
A count...
@Doorknob冰, hehehe =) I guess a few people have looked at only the title and thought... "I have to correct that immediately! How is it that no one has done it yet??" =P
@StewieGriffin I don't know if I interpreted your precision requirement correctly. The highest radius with an output below 1e5 is 13, so I assumed that 13³ times the absolute difference between my constant and the real value must be smaller than 0.005? 1. Is that what you had in mind? 2. Could you simply specify a maximal absolute difference for the Pi constant to make the rules easier to understand?
@Dennis, yes, that was what I had in mind. I won't be in front of a computer until tomorrow so I can't change the question text myself ATM (I'm quite sure I'll screw it up somehow).
I just voted on an answer and got this:
Daily vote limit reached; vote again in 8 hours.
You haven't voted on questions in a while; questions need votes too!
The idea of the message itself makes sense (putting aside the fact that by the very nature of the Programming Puzzles & Cod...
@StewieGriffin OK, since 4 / 3 * 13 ** 3 * 0.000001707 = 0.0050004, the error in the Pi constant should be lower than 0.000001707, and an error in a 4Pi/3 constant should be lower than 0.000002276. If you confirm that, I'll edit it into the challenge.
Broken FizzBuzz - Greg Is Confused underhanded popularity-contest
(FizzBuzz suggested by quartata in chat)
Meet Greg. Greg is a programmer. He deals with checking programs to see if they work. If they don't, he tries to find why.
Greg is rather new to programming and understands the basics, bu...
I'm not a big fan of anti-malware software any way. It has done more harm than good on my computers.
I mean, I wouldn't recommend my mom to uninstall her virus scanner, but some computer knowledge plus the necessary precautions work better that any virus scanner possible could.
Random Walk Printer
Draw a program that will write to STDOUT every m miliseconds and n times a string that contains a dot . at the location of the walker.
A random walk is a mathematical formalization of a path that consists of a succession of random steps (wiki), such that every new step will ...
I would suggest that repeated digits are placed next to each other with no spaces and that the space between digits is (highest number of digits on top or bottom) + 1. I also think the idea of a related compainion challenge would be good. — ASCIIThenANSI2 mins ago
^ any opinions on this? actually sounds like quite a good option to me.
Draw a program that will write to STDOUT n times a string that contains a dot . at the location of the walker. The program also needs to write a line every s seconds (or wait s seconds after each line).
A random walk is a mathematical formalization of a path that consists of a succession of rand...
You decide to host a large LAN party at your college campus. However, instead of getting normal Ethernet cables and routers, the junkie that you put in charge of getting networking supplies decided to bring a bunch of Ethernet cross cables - i.e. they must be connected computer-to-computer. As yo...
Use select(undef,undef,undef,$timeout) instead of Time::HiRes
(Taken from http://stackoverflow.com/a/896928/4739548)
Many challenges require you to sleep with greater precision than integers. select()'s timeout argument can do just that.
select($u,$u,$u,0.1)
is much more efficient than:
imp...
So what? The algorithms exist in those languages, why port it when everything works. I worked two years in Bioinformatics research. There is an incredible amount of proprietary algorithms and languages in this field (by the way, it doesn't matter what the student know, the research institutes that provide the data determine what you have to use). Eventually we agreed that every team member could write anything in any language they want, as long as it runs on the server.
But if you have to write the paper, you'll have to provide R (or Matlab) implementations.