diff --git a/README.md b/README.md index a61b7f8..8783a7a 100644 --- a/README.md +++ b/README.md @@ -61,15 +61,30 @@ Why use make instead of the built-in go commands? Because the point of make is t ## Usage together with standard Linux utilities -``` +```bash f -ed -u "s|#.*||" | sed -u 's|M|000000|g' | f +sed -u "s|#.*||" | sed -u 's|M|000000|g' | f + cat more/piano-tuners.f | f cat more/piano-tuners-commented.f | sed -u "s|#.*||" | sed -u 's|M|000000|g' | f + tee -a input.log | go run f.go | tee -a output.log tee -a io.log | go run f.go | tee -a io.log + +function f(){ + sed -u "s|#.*||" | + sed -u "s|//.*||" | + sed -u 's|K|000|g' | + sed -u 's|M|000000|g' | + sed -u 's|B|000000000|g' | + /usr/bin/f +} ``` +## Tips & tricks + +Conceptually clearer to have all the multiplications first and then all the divisions + ## Roadmap - [x] Write README @@ -81,3 +96,5 @@ tee -a io.log | go run f.go | tee -a io.log - [x] Add show more info version - [ ] Program into a small device, like a calculator? - [ ] Think of some way of calling bc +- [ ] Think how to integrate with squiggle.c to draw samples +- [ ] Think about how to draw a histogram from samples diff --git a/f.go b/f.go index 333b984..b4ce2a3 100644 --- a/f.go +++ b/f.go @@ -82,7 +82,9 @@ EventForLoop: fmt.Printf("=> %.1f %.1f\n", old_low, old_high) logmean_old, logstd_old := boundsToLogParams(old_low, old_high) fmt.Printf("=> Lognormal, with logmean: %.1f, logstd: %.1f\n", logmean_old, logstd_old) + continue EventForLoop } + fmt.Println(error_msg_cont) continue EventForLoop case 2: new_low, err1 = strconv.ParseFloat(tokens[0], 64)