From: John Benediktsson Date: Sun, 3 Sep 2023 03:31:05 +0000 (-0700) Subject: periodic-table: factor out the X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=a562e321b0e86645cc8d7ec9ed7a0ed5159aa011 periodic-table: factor out the --- diff --git a/extra/periodic-table/periodic-table.factor b/extra/periodic-table/periodic-table.factor index ecdb3e5cd9..05af5e8990 100644 --- a/extra/periodic-table/periodic-table.factor +++ b/extra/periodic-table/periodic-table.factor @@ -3,8 +3,7 @@ USING: accessors assocs colors kernel math math.parser sequences ui ui.gadgets ui.gadgets.borders ui.gadgets.buttons -ui.gadgets.labels ui.gadgets.tracks ui.gestures ui.pens.solid -webbrowser ; +ui.gadgets.labels ui.gadgets.tracks ui.pens.solid webbrowser ; IN: periodic-table @@ -171,16 +170,20 @@ CONSTANT: periodic-table { : ( atomic-number/f -- element ) [ - dup 1 - elements nth [ second swap ] [ first3 ] bi + dup 1 - elements nth first3 [ ] [ group-colors at ] bi* ] [ - f ""