about summary refs log tree commit diff stats
path: root/client.c
diff options
context:
space:
mode:
authorarg@mig29 <unknown>2006-10-27 12:05:47 +0200
committerarg@mig29 <unknown>2006-10-27 12:05:47 +0200
commit2b13e7466f4912e3778bf59e6aec3065443f08fe (patch)
tree2595de166d7113d6b0cf6c96139f7ae25fb38b39 /client.c
parent0982e47408115de4a604d9365b1014ae6205b3a9 (diff)
downloaddwm-2b13e7466f4912e3778bf59e6aec3065443f08fe.tar.gz
applied sanders max size fix
Diffstat (limited to 'client.c')
-rw-r--r--client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/client.c b/client.c
index 988d3ca..d04692d 100644
--- a/client.c
+++ b/client.c
@@ -233,7 +233,7 @@ manage(Window w, XWindowAttributes *wa) {
 	settags(c, getclient(trans));
 	if(!c->isfloat)
 		c->isfloat = trans
-			|| (c->maxw && c->minw &&
+			|| (c->maxw && c->minw && c->maxh && c->minh &&
 				c->maxw == c->minw && c->maxh == c->minh);
 	resizetitle(c);
 	if(clients)
ont-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/env gosh
(use scheme.set)

(define max-num 746325)
(define min-num 264360)
(define num-range (iota (- max-num min-num -1) min-num))

(define (digit-list number) (map digit->integer (string->list (number->string number))))

(define (valid-pw? number)
  (letrec ((num-list (digit-list number))
           (sorted-num-list (sort num-list))
           (num-set (list->set eq-comparator num-list)))
    (and
      (> (length num-list) (set-size num-set))
      (equal? sorted-num-list num-list))))

(define part1
  (length (filter valid-pw? num-range)))

(define (valid-count? number)
  (letrec ((num-list (digit-list number))
           (counts
            (fold 
              (lambda (element hashtable) (hash-table-update! hashtable element (cut + 1 <>) 0) hashtable)
              (make-hash-table eq-comparator)
              num-list)))
    (any (lambda (x) (= x 2)) (hash-table-values counts))))

(define part2
  (length (filter (lambda (x) (and (valid-pw? x) (valid-count? x))) num-range)))

(define (main args)
  (print part1)
  (print part2))