Skip to content

Commit 7b7c7da

Browse files
authored
Merge pull request #3905 from RKBoss6/funFacts
Add new fun facts to Fact list
2 parents 57af60a + f25d0a8 commit 7b7c7da

File tree

6 files changed

+200
-12
lines changed

6 files changed

+200
-12
lines changed

apps/textfacts/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
0.01: New Module!
22
0.02: Removed many non-interesting facts
3+
0.03: Removed redundant facts, added many new facts and added a clkinfo to get random facts from a clock face.

apps/textfacts/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ use whichever one is installed.
2727

2828
## Adding new facts
2929

30-
Add then to `facts.txt`, then re-run the code from inside the `getText` function in `lib.js`, paste the base64 code produced in an update the value in `getCount()`
30+
Add then to `facts.txt`, then re-run the code from inside the `getText` function in `lib.js`, paste the base64 code produced in an update the value in `getCount()`, and change the count number in the module as well.
31+
32+
## Clock Info
33+
34+
This module provides a clockInfo. In any clock, you can tap the clockInfo to open a prompt with a new fact.

apps/textfacts/clkinfo.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
(function() {
2+
return {
3+
name: "Facts",
4+
items: [
5+
{ name : "Facts",
6+
get : () => ({ text : "Fact",
7+
img : atob("GBiBAB8A+D/D/DBmDDA8DLYYbbeZ7bDbDbAYDbAYDbcY7bHbjbBaDbAYDbcY7bHZjbBaDbAYDbgYPZ+Z/YHbgYA+AZ///f///4AYAA==") }),
8+
show : function() { // shown - if running, start animation
9+
this.emit('redraw');
10+
},
11+
hide: function(){
12+
// Intentionally left blank: no action needed when hiding
13+
},
14+
run : function() { // tapped - cycle between start and stop
15+
E.showPrompt(require('textsource').getRandomText().txt,{
16+
title: "Fun Fact",
17+
buttons:{"Ok":true}
18+
}).then(function(v){
19+
Bangle.load();
20+
});
21+
}
22+
}
23+
]
24+
};
25+
})

apps/textfacts/facts.txt

Lines changed: 157 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
This list of facts was created by asking the Google Gemini AI
21
Black holes are regions of spacetime where gravity is so strong that nothing can escape
32
Blue whales are filter feeders that eat krill
43
Blue whales are the largest animals on Earth
@@ -159,5 +158,160 @@ The ureters are two tubes that carry urine from the kidneys to the bladder
159158
The urethra is a tube that carries urine out of the body
160159
The Venus flytrap is native to North and South Carolina
161160
Uranus rotates on its side
162-
Venus is the hottest planet in our solar system
163-
Viruses are smaller than bacteria and can only replicate inside living cells
161+
A group of lemurs is called a conspiracy
162+
The human heart can squirt blood up to 30 feet
163+
Australia is wider than the Moon
164+
The only letter not in the periodic table is J
165+
There are more fake flamingos than real ones
166+
Sharks are older than trees
167+
Your tongue is not a single muscle
168+
There are more stars in the universe than grains of sand on Earth
169+
Lightning is hotter than the surface of the Sun
170+
There’s a diamond planet called 55 Cancri e
171+
Hawaii is drifting toward Japan
172+
The smell of rain is called petrichor
173+
Some fungi can turn insects into zombies
174+
Honey never spoils
175+
There are more trees on Earth than stars in the Milky Way
176+
A whip crack is a tiny sonic boom
177+
Over 2,000 thunderstorms occur at any time on Earth
178+
A group of ravens is an unkindness
179+
The masseter is the strongest muscle
180+
You can’t sneeze with your eyes open
181+
Space smells like seared steak and metal
182+
A flock of flamingos is a flamboyance
183+
The dot over “i” and “j” is a tittle
184+
A group of ferrets is a business
185+
The longest single-word palindrome is “rotator”
186+
Vending machines kill more people than sharks
187+
Fresh-cut grass smell is a distress signal
188+
Cows don’t have upper front teeth
189+
Switzerland bans owning just one guinea pig
190+
The universe has no center
191+
Some cats are allergic to humans
192+
A glass of water contains more atoms than there are glasses of water in all the oceans
193+
Ketchup was once medicine
194+
Chewing gum dates back 9,000 years
195+
A group of unicorns is a blessing
196+
Wombat poop is cube-shaped
197+
The Pringles inventor is buried in a Pringles can
198+
There are more artificial trees than real ones
199+
A group of rhinos is a crash
200+
“Go” is the shortest complete English sentence
201+
Hot water can freeze faster than cold
202+
The Moon has moonquakes
203+
The quietest room is at Microsoft
204+
Polar bears have black skin
205+
Humans can remember 50,000 scents
206+
Six months of life is spent waiting at red lights
207+
The oldest tree is over 5,000 years old
208+
A group of owls is a parliament
209+
Cows have regional accents
210+
Chess has more permutations than atoms
211+
A “butt” was a wine unit
212+
Humans are the only animals that blush
213+
Chickens can fly for 13 seconds
214+
Pigs can’t look up
215+
A group of hippos is a bloat
216+
The shortest flight is under two minutes
217+
Fear of long words is ironically named
218+
The brain uses 20% of body energy
219+
Orange was named after the fruit
220+
Newborn pandas are mouse-sized
221+
Australia has no active volcanoes
222+
Sound travels faster in water
223+
Challenger Deep is Earth’s deepest ocean point
224+
A group of kangaroos is a mob
225+
Coconuts kill more than sharks
226+
Greenland sharks live over 500 years
227+
Earth’s core is as hot as the Sun
228+
A group of sloths is a bed
229+
Lifetime saliva fills two pools
230+
The stapes is the smallest bone
231+
The largest snowflake was 15 inches wide
232+
Deck shuffles exceed atoms on Earth
233+
A group of hedgehogs is an array
234+
Ocean plastic exceeds 150 million tons
235+
There are more chickens than humans
236+
People average 7,500 steps daily
237+
North Korea’s animal is the Chollima
238+
Sloths digest food for two weeks
239+
The longest yawn was 1 hour 15 minutes
240+
Some fungi glow
241+
A woman invented the stop sign
242+
The atmosphere is ~100 km thick
243+
A group of armadillos is a roll
244+
The oldest instrument was a vulture-bone flute
245+
The brain is more active at night
246+
Two weeks of life is spent kissing
247+
The shortest war lasted under an hour
248+
Bats are the only true flying mammals
249+
Mount Everest isn’t farthest from Earth’s center
250+
Bacteria outweigh all animals
251+
The universe is expanding faster
252+
Scotland’s national animal is the unicorn
253+
Butterflies taste with feet
254+
Most people can’t lick their elbow
255+
A jiffy is real
256+
The Great Wall isn’t visible from space
257+
Books smell: bibliosmia
258+
Phones are checked ~150 times daily
259+
Humans contain enough iron for a nail
260+
Go has more positions than atoms
261+
Microwaves bake potatoes in 6 minutes
262+
Earth is an oblate spheroid
263+
Earth’s rotation is slowing
264+
Images process faster than text
265+
Red blood cells live 120 days
266+
The biggest hot dog was 60 feet
267+
There are 400+ shark species
268+
Humans sleep 26 years total
269+
“Hello” became common in 1827
270+
Human lungs equal a tennis court
271+
A group of pugs is a grumble
272+
A group of moles is a labor
273+
A group of squid is a squad
274+
A group of crocodiles is a bask
275+
A group of cats is a clowder
276+
A group of platypuses is a paddle
277+
Venus flytraps count how many times their trigger hairs are touched before closing.
278+
Bananas are berries, but strawberries are not.
279+
The human brain has no pain receptors.
280+
Water can boil and freeze at the same time at its triple point.
281+
Tardigrades can survive the vacuum of space.
282+
The average cloud can weigh over a million tons.
283+
Trees communicate and share nutrients through underground fungal networks called the “wood wide web.”
284+
The Sun contains about 99.8% of the total mass of the solar system.
285+
Your bones are stronger than steel by weight.
286+
There are more neurons in the human gut than in a cat’s brain.
287+
Some spiders travel long distances by riding electric fields in the air.
288+
The color magenta does not exist on the visible light spectrum.
289+
Gold is edible and used in some luxury foods.
290+
Ancient Romans used urine as a cleaning agent.
291+
The Moon is slowly moving away from Earth each year.
292+
Hot peppers evolved their spiciness to deter mammals, not birds.
293+
The Eiffel Tower grows taller during the summer due to heat expansion.
294+
Human fingerprints and koala fingerprints are extremely similar.
295+
Penguins propose to their mates by offering pebbles.
296+
Oxygen itself does not burn; it only supports combustion.
297+
A day on Mercury lasts longer than a year on Mercury.
298+
The human eye can distinguish around ten million colors.
299+
Slime molds can find the most efficient path through a maze.
300+
Jellyfish existed before trees.
301+
Diamonds can burn at high temperatures.
302+
A teaspoon of neutron star material would weigh billions of tons.
303+
Music activates the brain’s reward system in the same way food does.
304+
Some frogs can freeze solid and revive when thawed.
305+
The Moon has traces of rust on its surface.
306+
There are bacteria that can feed on radiation.
307+
Your brain slightly predicts the future to compensate for processing delay.
308+
Birds do not urinate; waste exits in a single combined form.
309+
Glass is an amorphous solid, not a liquid.
310+
A single human hair can support several ounces of weight.
311+
Ants produce their distinctive smell using formic acid.
312+
Saturn is less dense than water and could theoretically float.
313+
Humans share about 60% of their DNA with bananas.
314+
There are taste receptors in your lungs and intestines.
315+
Some metals can “remember” and return to a previous shape.
316+
A cockroach can survive for weeks without its head.
317+
The human body is slightly bioluminescent.

apps/textfacts/lib.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
exports = {};
22
exports.getCount = function() {
3-
return 162;
3+
return 317;
44
};
55
exports.getText = function(n) {
6-
/*var s = require("Storage").read("textsource.txt");
6+
/*
7+
var s = require("Storage").read("textsource.txt");
78
var idx = s.indexOf("\n");
89
var lengths = [idx];
10+
911
while (idx>=0) {
1012
var next = s.indexOf("\n",idx+1);
1113
if (next>=0) {
@@ -17,7 +19,8 @@ exports.getText = function(n) {
1719
}
1820
print(`Count = ${lengths.length}`);
1921
print(`var idxs = E.toUint8Array(atob("${btoa(lengths)}"));`);*/
20-
var idxs = E.toUint8Array(atob("PVguLS4qQScgVTtRLC4vMTwyKiowJjI+PzAnSigsLCssHTFSOkRCMiZHSjhUWVNSPUNCLU8uRzVCNk1RQ0Y7ZDwxMDU7QFgkMTM1RTJpIzFFO0I8KDRJPVNBQDIuPzsyMjFQOEdGPyguODI4LkhCQB5BNi8uRCsqMTVOVjNFTmI1O0QyPyk5PC89M0gwTjE7QixTRSI2QSY1RkY1SUs5OBsw"));
22+
var idxs = E.toUint8Array(atob("Vy4tLipBJyBVO1EsLi8xPDIqKjAmMj4/MCdKKCwsKywdMVI6REIyJkdKOFRZU1I9Q0ItTy5HNUI2TVFDRjtkPDEwNTtAWCQxMzVFMmkjMUU7QjwoNEk9U0FAMi4/OzIyMVA4R0Y/KC44MjguSEJAHkE2Ly5EKyoxNU5WM0VOYjU7RDI/KTk8Lz0zSDBOMTtCLFFFIjZBJjVGRjVJSzk4GykvIS8tHCNCMCwgJikTOiI0IyUlKSYlITAuKyIsGyFXGiMiGzIvHS8mGCIcIjIoIBsnGScgEx0pJyIhHyIeLx4fJSIbICApJCEnJCElIScQHyAgLyIjJiYxHiEqHCMQKBgkJiEmHBwgHiAdHB4hHRwcIB0iVC8nQC0xZkQuP0lALi81QUdBNTo2OT0gKEJFNCwvTD0rOjg/Mjg7NCs="));
23+
2124
if (n<0 || n>=idxs.length) return;
2225
var idx = n ? E.sum(new Uint8Array(idxs.buffer,0,n))+1 : 0;
2326
var len = idxs[n]-1;
@@ -26,4 +29,4 @@ exports.getText = function(n) {
2629
exports.getRandomText = function() {
2730
let n = Math.floor(Math.random()*exports.getCount());
2831
return { idx : n, txt : exports.getText(n) };
29-
};
32+
};

apps/textfacts/metadata.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{ "id": "textfacts",
22
"name": "List of Facts",
33
"shortName":"Facts",
4-
"version":"0.02",
5-
"description": "A list of 160 'facts' from Google Gemini. Provides a `textsource` module that apps can use to query a random fact.",
4+
"version":"0.03",
5+
"description": "A list of fun facts. Provides a `textsource` module that apps can use to query a random fact, as well as a clockInfo to see facts on your favorite clock.",
66
"icon": "icon.png",
77
"type": "module",
8-
"tags": "",
8+
"tags": "clkinfo",
99
"provides_modules" : ["textsource"],
1010
"supports" : ["BANGLEJS2"],
1111
"readme": "README.md",
1212
"storage": [
1313
{"name":"textsource.txt","url":"facts.txt"},
14-
{"name":"textsource","url":"lib.js"}
14+
{"name":"textsource","url":"lib.js"},
15+
{"name":"textsource.clkinfo.js","url":"clkinfo.js"}
1516
]
1617
}

0 commit comments

Comments
 (0)