Re: [wmii] wmii 3.1 - patch for wrapping select_area()

From: Suraj N. Kurapati <skurapat_AT_ucsc.edu>
Date: Tue, 04 Jul 2006 17:01:10 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Suraj N. Kurapati wrote:
> Make column selection wrap around. So if I am at the right most
> column and I input "select the column at right", then wmii should
> select the left-most column. Same thing applies for the reverse
> case: selecting column to the left of left-most column will put
> focus on right-most column.

Attached is a patch which implements the above feature. I was a
surprised to find that negative integers don't wrap around in C as
they do in Ruby:

C:
 -4 % 4 => 0
 -3 % 4 => -3
 -2 % 4 => -2
 -1 % 4 => -1
  0 % 4 => 0
  1 % 4 => 1
  2 % 4 => 2
  3 % 4 => 3
  4 % 4 => 0

Ruby:
 -4 % 4 => 0
 -3 % 4 => 1
 -2 % 4 => 2
 -1 % 4 => 3
  0 % 4 => 0
  1 % 4 => 1
  2 % 4 => 2
  3 % 4 => 3
  4 % 4 => 0
- --
BASIC is to computer programming as QWERTY is to typing.
                -- Seymour Papert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEqwFGmV9O7RYnKMcRAmyoAJ9snqyBRsniL/AzP8NSWhKsAcJbvgCcC4IK
W20hYARnrGZ4mfMmkTAsKCc=
=+EQ5
-----END PGP SIGNATURE-----

Received on Wed Jul 05 2006 - 02:01:17 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:10:40 UTC