;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/hockey/og.el - Olympic Games ;; ;; also see: ;; https://dataswamp.org/~incal/hockey/wj.el - World Juniors ;; https://dataswamp.org/~incal/hockey/wc.el - World Championship ;; ;; source: ;; https://en.wikipedia.org/wiki/List_of_Olympic_medalists_in_ice_hockey ;; ;; country codes are ISO 3166-1 alpha-3: ;; https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3 ;; ;; notes: ;; * The 1976 bronze medalist is formally West Germany; ;; here, Germany is stated. ;; ;; * The 1992 gold medalist is formally the Unified Team ;; representing Armenia, Belarus, Kazakhstan, Russia, ;; Ukraine and Uzbekistan - here, SSSR is stated. ;; ;; * The 2018 gold medalist is formally OAR, Olympic ;; Athletes from Russia; here, Russia is stated. ;; ;; * We always use Czechia and never the Czech Republic. ;; ;; fun fact: ;; Did Russia ever win the ice hockey tournament at the ;; Olympics? It doesn't look like it. In 1956, as well as ;; four times 1964-1976, and again two times 1984-1988, the ;; winner was the Soviet Union. In 1992, the winner was the ;; Unified Team. And in 2018 the winner was the OAR. So did ;; they ever win? It doesn't look like it! (defun wog-how-many-medals (nat &optional pos) (or pos (setq pos 1)) (let ((col (nth (1- pos) '(8 23 38)))) (how-many (format "^.\\{%d\\}%s" col nat) (wog-point-at-string "Olympics") (point-max) ))) (defun wog-point-at-string (s) (save-excursion (search-forward s) (point) )) ;; all winners (when nil (wog-how-many-medals "Canada" 1) ; 9 <-- 1 (wog-how-many-medals "Canada" 2) ; 4 (+ (wog-how-many-medals "SSSR" 1) ; 8 (wog-how-many-medals "Russia" 1) ; 1 ) ; 9 <-- 2 ; (+ (wog-how-many-medals "SSSR" 2) ; 1 (wog-how-many-medals "Russia" 2) ; 1 ) ; 3 (wog-how-many-medals "USA" 1) ; 2 <-- 3 (wog-how-many-medals "USA" 2) ; 8 (wog-how-many-medals "Sweden" 1) ; 2 (wog-how-many-medals "Sweden" 2) ; 3 (+ (wog-how-many-medals "Czechoslovakia" 1) ; 0 (wog-how-many-medals "Czechia" 1) ; 1 ) ; 1 ; (+ (wog-how-many-medals "Czechoslovakia" 2) ; 4 (wog-how-many-medals "Czechia" 2) ; 0 ) ; 4 (wog-how-many-medals "Finland" 1) ; 1 (wog-how-many-medals "Finland" 2) ; 2 (wog-how-many-medals "UK" 1) ; 1 (wog-how-many-medals "UK" 2) ; 0 ) ;; ---------------------------------------------------------------------------- ;; gold silver bronze Olympics Games ;; ---------------------------------------------------------------------------- ;; 1920 Canada USA Czechoslovakia Antwerp BEL ;; 1924 Canada USA UK Chamonix FRA ;; 1928 Canada Sweden Switzerland St Moritz CHE ;; 1932 Canada USA Germany Lake Placid USA ;; 1936 UK Canada USA Garmisch-Partenkirchen DEU ;; 1948 Canada Czechoslovakia Switzerland St Moritz CHE ;; 1952 Canada USA Sweden Oslo NOR ;; 1956 SSSR USA Canada Cortina d'Ampezzo ITA ;; 1960 USA Canada SSSR Squaw Valley USA ;; 1964 SSSR Sweden Czechoslovakia Innsbruck AUT ;; 1968 SSSR Czechoslovakia Canada Grenoble FRA ;; 1972 SSSR USA Czechoslovakia Sapporo JPN ;; 1976 SSSR Czechoslovakia West Germany Innsbruck AUT ;; 1980 USA SSSR Sweden Lake Placid USA ;; 1984 SSSR Czechoslovakia Sweden Sarajevo YUG ;; 1988 SSSR Finland Sweden Calgary CDN ;; 1992 SSSR Canada Czechoslovakia Albertville FRA ;; 1994 Sweden Canada Finland Lillehammer NOR ;; 1998 Czechia Russia Finland Nagano JPN ;; 2002 Canada USA Russia Salt Lake City USA ;; 2006 Sweden Finland Czechia Turin ITA ;; 2010 Canada USA Finland Vancouver CDN ;; 2014 Canada Sweden Finland Sochi RUS ;; 2018 Russia Germany Canada Pyeongchang ROK ;; 2022 Finland Russia Slovakia Beijing PRC