aboutsummaryrefslogtreecommitdiffstats
path: root/src/c_player.go
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2022-04-01 17:42:41 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2022-04-01 17:42:41 +0200
commitdf97122c656819c79a43aa8931f95e84688cbc1f (patch)
treea5fed6eb8d598efd423b9227db177c34cc70c014 /src/c_player.go
parentSet up default options, now going for random and true parse (diff)
downloadgo2work-df97122c656819c79a43aa8931f95e84688cbc1f.tar.gz
go2work-df97122c656819c79a43aa8931f95e84688cbc1f.tar.bz2
go2work-df97122c656819c79a43aa8931f95e84688cbc1f.tar.xz
go2work-df97122c656819c79a43aa8931f95e84688cbc1f.tar.zst
go2work-df97122c656819c79a43aa8931f95e84688cbc1f.zip
Good progress
Diffstat (limited to 'src/c_player.go')
-rw-r--r--src/c_player.go21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/c_player.go b/src/c_player.go
index 7729d8a..f3485be 100644
--- a/src/c_player.go
+++ b/src/c_player.go
@@ -39,7 +39,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* go2work: src/c_player.go
- * Wed Mar 30 13:20:13 CEST 2022
+ * Fri Apr 1 17:40:31 CEST 2022
* Joe
*
* Funcs to play the file
@@ -54,9 +54,24 @@ import (
"os/exec"
)
-func exec_player(show_fortune bool, player string, args ...string) {
+func has_rang() (f func()(int)) {
+ var i int
+ i = 0
+ f = func()(int) {
+ i++
+ return i
+ }
+ return
+}
+
+func exec_player(
+ show_fortune bool,
+ has_rang bool,
+ player string,
+ args ...string,
+) {
var cmd *exec.Cmd
- if show_fortune == true {
+ if show_fortune == true && has_rang == false {
fmt.Print("\n\n")
cmd = exec.Command("fortune", "-s")
var out bytes.Buffer