@orlp I may be missing something, but I can't figure out how to apply this to axabababa abababaxa. All b's except one shouldn't move neither left nor right.
Dependency Graph Visualization
code-golf graph ascii-art
The goal of this challenge is to write a program that visualizes a dependency graph in the form of a tree.
While "dependency graph" in this context means nothing more than a directed graph, the visualization method described here works be...
They haven't registered themselves on the site by OpenID. They are logged in with a long living cookie tied to a specific PC/webbrowser. They won't be able to login using the same account on other PCs/webbrowsers.
Looking for really long file names on my system, it turns out I have a file called ~/.gradle/wrapper/dists/gradle-1.11-all/7qd8qq8te5j4f5q9aaei3gh3lj/gradle-1.11/docs/dsl/org.gradle.nativebinaries.language.c.tasks.AbstractNativeCompileTask.html.
I just finished writing a question, but after reading back over it I'm not sure how clear it may seem to another person, although its perfectly clear to myself. Should I push it through the Sandbox first?
My first 5 or so questions weren't pushed through the Sandbox (I wasn't aware it existed at the time), and I ended up sheepishly answering questions in the comments.
@ZachGates feedback: 1. a lot of the specification is mentioned for the first time in the example at the end. I'd probably try starting with that. 2. what sort of precision is required for the intermediate results of the heights/times?
The Challenge
Write a program that can calculate how many times and how long a ball will bounce based on a few input variables.
Input
There are three variables that will be passed. You can accept these however you like (user input, function call, etc). The variables are as follows:
height
...
@MartinBüttner I addressed your first point with an edit to my post; let me know what you think. As for your second point, could you clarify what you mean by "intermediate results of the heights/times"?
"Both of these will be rounded up to the nearest whole number." doesn't really make sense because the number of bounces is an integer to begin with
@ZachGates well in your calculations you are using heights and times like 0.625. how accurate do you want these intermediate calculations to be? (because rounding errors will propagate and might affect the final results)
∞ (infinity) would be the correct answer, but I suppose that might be harder to convey in some languages. I think I might just change it where 0.00 ≤ B < 1.00. @MartinBüttner
oh and if you made B a percentage (i.e. an integer instead of a float), that would probably me more inclusive for many languages, because then both input and output would be integers, and calculations can be done with integers by multiplying by 10k and dividing at the end.
(of course that's still possible in the current form, but it adds the probably non-negligible overhead of ignoring the . in the input)
I've figured out that just p is enough to get http://codegolf.stackexchange.com to come up first in the autocomplete list, but it's too hard to remember :P
I am a teacher who was given a problem a few years ago. Every year since I have given it to my advanced students as a bonus assignment, but in ~10 years only 8 solved it, each with a slightly different approach. The problem is as follows:
You have some input, in the following format (minus //com...