Probabilistic methods for causal discovery are based on the detection of patterns of correlation between variables. They are based on statistical theory and have revolutionised the study of causality. However, when correlation itself is unreliable, so are probabilistic methods: nonsense correlations can lead to spurious causal links, while nonmonotonic functional relationships between variables can prevent the detection of causal links. We describe a new heuristic method for inferring causality between two continuous or integer variables, based on a nonparametric randomness test. We evaluate the accuracy of the method by comparing it to published algorithms on real and artificial datasets, and show that it largely avoids these false positives and negatives.