* trekking, compute sum of weight of items, Edmund Hillary and Tenzing Norgay
@ 2020-03-25 1:08 Emanuel Berg via Users list for the GNU Emacs text editor
0 siblings, 0 replies; only message in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-03-25 1:08 UTC (permalink / raw)
To: help-gnu-emacs
<incal> I have now compiled a list of 18 items, and wrote
some Elisp to sum the weight, it is already at
7.4 kg. I think 10 kg is some sort of practical,
physical, and/or psychological maximum
<incal> <https://dataswamp.org/~incal/TENT>
<incal> PS. when Edmund Hillary made the 8335-8500 meter
climb on his way to the top of Mt. Everest, together
with Tenzing Norgay in 1953, they each carried
23-28 kg. it was -27C and the inclination 30-45
degrees
I yank the file here ... Elisp last! The problem with
`digits-sum' is that you can't use digits anywhere else,
that's why I put the sum converted to Roman Numerals,
otherwise, the next time you do the count, the sum will be
included as well! (Another way to do this, is to include
a unit, grams or g in this case, without a whitespace - some
people like to do that anyway (exclude the whitespace), so
why not? e.g. 8000mAh and 7383g.) anyway:
comb ? see "even more"
comic book 580
drybag 305
flashlight (3AAA) 73
flashlight (USB) 55
knife 90
piece of cloth (big) 100
piece of cloth (small) 60
powerbank 8000mAh 245
science book 411
skin lotion ? see "even more"
sleeping bag 1215
sleeping pad 880
spoon/fork ? see "even more"
sticky tape 90
tent 2515
Trangia 619
water bottle 115
even more 30
---------------------
MMMMMMM CCC L XXX III
(defun digits-sum ()
(interactive)
(save-excursion
(goto-char (point-min))
(let ((sum 0))
(while (forward-word)
(let ((number (number-at-point)))
(when number
(cl-incf sum number) )))
(message "%s" sum) )))
(defalias 'd #'digits-sum)
----------------------------------------------------------------------
this file: https://dataswamp.org/~incal/TENT
--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-25 1:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-25 1:08 trekking, compute sum of weight of items, Edmund Hillary and Tenzing Norgay Emanuel Berg via Users list for the GNU Emacs text editor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).