[comp.emacs] getris patch #2

mad@math.keio.JUNET (MAEDA Atusi) (09/17/89)

For those people who got "Args out of range" error running getris,
here is the patch to avoid the bug in cl.el division routine.

This replaces the call to `mod' function to `%', which is synonymous
to built-in `mod'.

;;;  Keio University
;;;    Faculty of Science and Technology
;;;      Department of Math
;;;		MAEDA Atusi (In Japan we write our family names first.)
;;;		mad@nakanishi.math.keio.ac.jp

*** getris.el.orig	Sat Sep 16 22:22:15 1989
--- getris.el	Sun Sep 17 23:51:33 1989
***************
*** 4,9 ****
--- 4,10 ----
  ;; Modified by Hideto Sazuka Thu Jun 29 12:09:36 1989
  ;; Modified by MAEDA Atusi Thu Jun 29 20:50:16 1989
  ;; Modified by MAEDA Atusi Wed Jul  5 20:21:31 1989
+ ;; Modified by MAEDA Atusi Sun Sep 17 23:50:47 1989
  
  ;; This file is part of GNU Emacs.
  
***************
*** 231,240 ****
  	(disp (/ getris-width 4))
  	delay-count
  	x y direction kind)
!     (while (progn (setq x (+ center (ash (mod (random) disp) 1))
  			y -1
! 			direction (mod (abs (random)) 4)
! 			piece-num (mod (abs (random)) 7)
  			piece-vector (aref getris-piece-data piece-num)
  			piece-data (aref piece-vector direction))
  		  (getris-puttable-p x 0 piece-data))
--- 232,241 ----
  	(disp (/ getris-width 4))
  	delay-count
  	x y direction kind)
!     (while (progn (setq x (+ center (ash (% (random) disp) 1))
  			y -1
! 			direction (% (abs (random)) 4)
! 			piece-num (% (abs (random)) 7)
  			piece-vector (aref getris-piece-data piece-num)
  			piece-data (aref piece-vector direction))
  		  (getris-puttable-p x 0 piece-data))