You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
700 B
17 lines
700 B
<DIV STYLE=TEXT-ALIGN:RIGHT;FONT-SIZE:1.7PX> |
|
<div id="container"></div> |
|
<script> |
|
const container = document.getElementById("container"); |
|
for (let i = 0; i < 243; i++) { |
|
const ternary = i.toString(3).padStart(0,"0"); |
|
const TWOS = (ternary.match(/2/g) || []).length; |
|
const ones = (ternary.match(/1/g) || []).length; |
|
const ZEROS = (ternary.match(/0/g) || []).length; |
|
const bar2 = "🟠".repeat(TWOS); |
|
const bar1 = "🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢".repeat(ones); |
|
const bar0 = "🟣".repeat(ZEROS); |
|
const div = document.createElement("div"); |
|
div.textContent = ternary+ ""+ bar0 + bar1+bar2; |
|
container.appendChild(div); |
|
} |
|
</script>
|
|
|