Function: gamegrid-add-score

gamegrid-add-score is a byte-compiled function defined in gamegrid.el.gz.

Signature

(gamegrid-add-score FILE SCORE &optional REVERSE)

Documentation

Add the current score to the high score file.

If REVERSE is non-nil, treat lower scores as better than higher scores. This is useful for games where lower scores are better.

On POSIX systems there may be a shared game directory for all users in which the scorefiles are kept. On such systems Emacs doesn't create the score file FILE in this directory, if it doesn't already exist. In this case Emacs searches for FILE in the directory specified by gamegrid-user-score-file-directory and creates it there, if necessary.

To add the score file for a game to the system wide shared game directory, create the file with the shell command "touch" in this directory and make sure that it is owned by the correct user and group. You probably need special user privileges to do this.

On non-POSIX systems Emacs searches for FILE in the directory specified by the variable temporary-file-directory(var)/temporary-file-directory(fun). If necessary, FILE is created there.

Probably introduced at or before Emacs version 27.1.

Source Code

;; Defined in /usr/src/emacs/lisp/play/gamegrid.el.gz
;; ;;;;;;;;;;;;;;; high score functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun gamegrid-add-score (file score &optional reverse)
  "Add the current score to the high score file.

If REVERSE is non-nil, treat lower scores as better than higher
scores.  This is useful for games where lower scores are better.

On POSIX systems there may be a shared game directory for all users in
which the scorefiles are kept.  On such systems Emacs doesn't create
the score file FILE in this directory, if it doesn't already exist.
In this case Emacs searches for FILE in the directory specified by
`gamegrid-user-score-file-directory' and creates it there, if
necessary.

To add the score file for a game to the system wide shared game
directory, create the file with the shell command \"touch\" in this
directory and make sure that it is owned by the correct user and
group.  You probably need special user privileges to do this.

On non-POSIX systems Emacs searches for FILE in the directory
specified by the variable `temporary-file-directory'.  If necessary,
FILE is created there."
  (pcase system-type
    ((or 'ms-dos 'windows-nt)
     (gamegrid-add-score-insecure file score reverse))
    (_
     (gamegrid-add-score-with-update-game-score file score reverse))))