[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
a new version of wj.el after the Edmonton 2021 tournament
From: |
Emanuel Berg |
Subject: |
a new version of wj.el after the Edmonton 2021 tournament |
Date: |
Fri, 08 Jan 2021 20:40:05 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Here is a new version of wj.el after the Edmonton 2021
tournament. 1 new function and 2 new comments, see "notes on
Edmonton 2021".
;;; this file:
;;; http://user.it.uu.se/~embe8573/hockey/wj.el
;;; https://dataswamp.org/~incal/hockey/wj.el
;;;
;;; also see:
;;; https://dataswamp.org/~incal/hockey/wc.el
;;; https://dataswamp.org/~incal/hockey/og.el
;;;
;;; source:
;;;
https://en.wikipedia.org/wiki/List_of_IIHF_World_Under-20_Championship_medalists
;;;
;;; notes:
;;; * medal computation fallout includes the unofficial
;;; World Juniors in 1974, 1975 and 1976
;;;
;;; * in 1992, the gold medal was formally claimed by the
;;; CIS, the "Commonwealth of Independent States", for
;;; practical reasons Russia is stated
;;;
;;; * in 1993, the bronze medal was formally claimed by the
;;; "Czech, Slovak Republics"; Czechoslovakia is stated
;;;
;;; notes on Edmonton 2021:
;;; * zero spectators because of covid-19
;;;
;;; * since 2010, three nations have dominated the WJs:
;;; USA (4 golds), Canada (3), and Finland (3). The only
;;; other gold medalists during that period, with one gold
;;; each, are Sweden (2012) and Russia (2011)
;;;
;;; (wj-find-gold-since 2010 "USA" ) ; 2010 2013 2017 2021
;;; (wj-find-gold-since 2010 "Canada" ) ; 2015 2018 2020
;;; (wj-find-gold-since 2010 "Finland") ; 2014 2016 2019
;;; (wj-find-gold-since 2010 "Sweden" ) ; 2012
;;; (wj-find-gold-since 2010 "Russia" ) ; 2011
(require 'cl-lib)
(defun wj-find-gold-since (year nation)
(cl-delete-if (lambda (g) (> year g)) (wj-find-gold nation) ))
(defun wj-find-gold (nation)
(save-excursion
(let*((search-string (concat ";; [0-9]\\{4\\} " nation))
(years) )
(while (re-search-forward search-string (point-max) t)
(push (string-to-number (substring (match-string 0) 3 7)) years) )
(reverse years)) ))
;; (wj-find-gold "Finland") ; (1987 1998 2014 2016 2019)
;; (wj-find-gold "USA") ; (2004 2010 2013 2017 2021)
(defun wj-how-many-medals (nation &optional position)
(let*((position (or position 1)) ; default: gold medal
(col (nth (1- position) '(8 23 38))) )
(how-many
(format "^.\\{%d\\}%s" col nation)
(wj-point-at-string "WJ")
(point-max) )))
(defun wj-point-at-string (s)
(save-excursion
(search-forward s)
(point) ))
;; all winners
(when nil
(wj-how-many-medals "Canada" 1) ; 18
(wj-how-many-medals "Canada" 2) ; 12
(+ (wj-how-many-medals "SSSR" 1) ; 11
(wj-how-many-medals "Russia" 1) ; 5
) ; 16
(+ (wj-how-many-medals "SSSR" 2) ; 3
(wj-how-many-medals "Russia" 2) ; 10
) ; 13
(wj-how-many-medals "Finland" 1) ; 5
(wj-how-many-medals "Finland" 2) ; 5
(wj-how-many-medals "USA" 1) ; 5
(wj-how-many-medals "USA" 2) ; 2
(wj-how-many-medals "Sweden" 1) ; 2
(wj-how-many-medals "Sweden" 2) ; 11
(+ (wj-how-many-medals "Czechoslovakia" 1) ; 0
(wj-how-many-medals "Czech Republic" 1) ; 2
(wj-how-many-medals "Slovakia" 1) ; 0
) ; 2
(+ (wj-how-many-medals "Czechoslovakia" 2) ; 5
(wj-how-many-medals "Czech Republic" 2) ; 0
(wj-how-many-medals "Slovakia" 2) ; 0
) ; 5
)
;; gold silver bronze unofficial WJ
;; ----------------------------------------------------------------------------
;; 1974 SSSR Finland Canada Leningrad
;; 1975 SSSR Canada Sweden Brandon, Winnipeg
;; 1976 SSSR Canada Czechoslovakia Pori, Rauna, Tampere, Turku
;;
;;
;; IIHF IHWJC
;; ----------------------------------------------------------------------------
;; 1977 SSSR Canada Czechoslovakia Banská Bystrica, Zvolen
;; 1978 SSSR Sweden Canada Montreal, Quebec City
;; 1979 SSSR Czechoslovakia Sweden Karlskoga, Karlstad
;; 1980 SSSR Finland Sweden Helsinki, Vantaa
;; 1981 Sweden Finland SSSR Füssen, Kaufbeuren,
Landsberg
;; 1982 Canada Czechoslovakia Finland Bloomington, Duluth,
Minneapolis; Kenora, Winnipeg
;; 1983 SSSR Czechoslovakia Canada Leningrad
;; 1984 SSSR Finland Czechoslovakia Norrköping, Nyköping
;; 1985 Canada Czechoslovakia SSSR Helsinki, Turku
;; 1986 SSSR Canada USA Hamilton, London, Toronto
;; 1987 Finland Czechoslovakia Sweden Nitra, Pieštany,
Topolčany, Trenčín
;; 1988 Canada SSSR Finland Moscow
;; 1989 SSSR Sweden Czechoslovakia Anchorage, Eagle River
;; 1990 Canada SSSR Czechoslovakia Helsinki, Turku
;; 1991 Canada SSSR Czechoslovakia Saskatoon, Regina
;; 1992 Russia Sweden USA Füssen, Kaufbeuren
;; 1993 Canada Sweden Czechoslovakia Falun, Gävle, Uppsala
;; 1994 Canada Sweden Russia Frydek-Místek, Ostrava
;; 1995 Canada Russia Sweden Calgary, Edmonton, Red
Deer
;; 1996 Canada Sweden Russia Amherst, Boston,
Marlborough
;; 1997 Canada USA Russia Geneva, Morges
;; 1998 Finland Russia Switzerland Helsinki, Hämeenlinna
;; 1999 Russia Canada Slovakia Brandon, Selkirk, Winnipeg
;; 2000 Czech Republic Russia Canada Skellefteå, Umeå
;; 2001 Czech Republic Finland Canada Moscow, Podolsk
;; 2002 Russia Canada Finland Hradec Králové, Pardubice
;; 2003 Russia Canada Finland Halifax, Sydney
;; 2004 USA Canada Finland Helsinki, Hämeenlinna
;; 2005 Canada Russia Czech Republic Grand Forks, Thief River
Falls
;; 2006 Canada Russia Finland Kamloops, Kelowna,
Vancouver
;; 2007 Canada Russia USA Leksand, Mora
;; 2008 Canada Sweden Russia Liberec, Pardubice
;; 2009 Canada Sweden Russia Ottawa
;; 2010 USA Canada Sweden Saskatoon, Regina
;; 2011 Russia Canada USA Buffalo, Lewiston
;; 2012 Sweden Russia Canada Calgary, Edmonton
;; 2013 USA Sweden Russia Ufa
;; 2014 Finland Sweden Russia Malmö
;; 2015 Canada Russia Slovakia Montreal, Toronto
;; 2016 Finland Russia USA Helsinki
;; 2017 USA Canada Russia Montreal, Toronto
;; 2018 Canada Sweden USA Buffalo, Orchard Park
;; 2019 Finland USA Russia Vancouver, Victoria
;; 2020 Canada Russia Sweden Ostrava, Trinec
;; 2021 USA Canada Finland Edmonton
--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- a new version of wj.el after the Edmonton 2021 tournament,
Emanuel Berg <=