Skip to content
View barabo's full-sized avatar
🤺
🤺
  • Mayo Clinic
  • United States

Sponsoring

@exercism

Block or report barabo

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
barabo/README.md
Hilbert Tiles

hilbert-6

Hilbert Tiles ASCII
 __ ___ ___ ___ ___ _____ ___ ___ ___ ___ _____ ___ ___ ___ ___ __
_| |_ |_| _| |_ |_| _| |_ _| |_ |_| _| |_ |_| _| |_ _| |_ |_| _| |_ |_| _| |_
| _ | _ |_ _| _ | _ | | _ | _ |_ _| _ | _ | | _ | _ |_ _| _ | _ |
|_| |_| | |___| |___| | |_| |_| |_| |_| | |___| |___| | |_| |_| |_| |_| | |___| |___| | |_| |_|
_ _ | ___ ___ | _ _ _ _ | ___ ___ | _ _ _ _ | ___ ___ | _ _
| |_| | |_| _| |_ |_| | |_| | | |_| | |_| _| |_ |_| | |_| | | |_| | |_| _| |_ |_| | |_| |
|_ _| _ |_ _| _ |_ _| |_ _| _ |_ _| _ |_ _| |_ _| _ |_ _| _ |_ _|
_| |___| |___| |___| |___| |_ _| |___| |___| |___| |___| |_ _| |___| |___| |___| |___| |_
| ___ ___ _ ___ ___ | | ___ ___ _ ___ ___ | | ___ ___ _ ___ ___ |
|_| _| |_ |_| |_| _| |_ |_| |_| _| |_ |_| |_| _| |_ |_| |_| _| |_ |_| |_| _| |_ |_|
_ |_ _| _ _ |_ _| _ _ |_ _| _ _ |_ _| _ _ |_ _| _ _ |_ _| _
| |___| |___| | | |___| |___| | | |___| |___| | | |___| |___| | | |___| |___| | | |___| |___| |
|_ _____ _| |_ _____ _| |_ _____ _| |_ _____ _| |_ _____ _| |_ _____ _|
_| |_ _| |_ _| |_ _| |_ _| |_ _| |_ _| |_ _| |_ _| |_ _| |_ _| |_ _| |_
| _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ |
|_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_|
Misc
How many syllables are in a number?

This code currently only supports whole numbers up to 1 undecillian - maybe someday I'll solve it generally.

defsyllables(n):
defexp_syllables(exp):
ifexp>10:
raiseValueError("1 undecillion and above are not supported!")
# Assuming million, billion, and trillion are pronounced with two syllables,# while powers through decillion have three.returnexp<4and2or3ifn==0:
return0ifnin [1, 2, 3, 4, 5, 6, 8, 9, 10, 12]:
return1ifnin [11, 17, 70]:
return3ifn<=20ornin [30, 40, 50, 60, 80, 90]:
return2ifn<100:
returnsyllables(10* (n//10)) +syllables(n%10)
ifn<1000:
hundreds=n//100return (hundreds==7and4or3) +syllables(n-100*hundreds)
exp=int(math.log10(n) //3) # thousands, millions, billions, ...power=int(math.pow(1000, exp))
leftmost=n//powerremainder=n-leftmost*powerreturnsyllables(leftmost) +exp_syllables(exp) +syllables(remainder)

Popular repositories Loading

  1. advanced-shell-history advanced-shell-historyPublic

    Advanced command line shell history - save your bash history to sqlite3 automatically!

    C 167 19

  2. fhir-to-omop-demo fhir-to-omop-demoPublic

    A demo to convert synthea FHIR data to OMOP

    Shell 11 5

  3. fhir-jq fhir-jqPublic

    A jq module to make it easier to work with FHIR resources from jq.

    jq 7 2

  4. swm-dd-demo swm-dd-demoPublic

    Demo code for the June 2021, HL7 DevDays - SMART Web Messaging Events

    JavaScript 3

  5. python-cmdline-bootstrap python-cmdline-bootstrapPublic

    Forked from jgehrcke/python-cmdline-bootstrap

    http://gehrcke.de/2014/02/distributing-a-python-command-line-application/

    Python 1

  6. Peasy.NET Peasy.NETPublic

    Forked from peasy/Peasy.NET

    A middle tier micro-framework for .NET

    C# 1