// Copyright 2022 wanderer // SPDX-License-Identifier: GPL-3.0-or-later package algo import ( "fmt" "os" ) func getSHCLogPrefix() string { return " ***  stochastic hill climbing:" } func fmtSHCOut(input string) string { return getSHCLogPrefix() + " " + input } func printSHC(input string) { if _, err := fmt.Fprintln(os.Stderr, fmtSHCOut(input)); err != nil { fmt.Fprintf( os.Stdout, getSHCLogPrefix(), "error while printing to stderr: %q\n * original message was: %q", err, input, ) } }