I hereby claim:
- I am ruyili on github.
- I am wecryopen (https://keybase.io/wecryopen) on keybase.
- I have a public key ASBErN8SGkckrb14D073PzIuuJUwbAoEmXSnAFQKiNEYFgo
To claim this, I am signing this object:
import type { Equal } from '@type-challenges/utils' | |
type IndexOf<T, U, C extends `According to all known laws of aviation, there is no way a bee should be able to fly. | |
Its wings are too small to get its fat little body off the ground. | |
The bee, of course, flies anyway because bees don't care what humans think is impossible. | |
Yellow, black. Yellow, black. Yellow, black. Yellow, black. | |
Ooh, black and yellow! | |
Let's shake it up a little. | |
Barry! Breakfast is ready! | |
Coming! |
const theme = { | |
color: 'blue', | |
padding: '1px 2px', | |
margin: '2px $padding $size', | |
size: '3rem' | |
} as const | |
type CSSSingleVarToken<S extends string> = S extends `$${infer _} ${infer _}` | |
? never | |
: S extends `$${infer K}` |
# Generated by Powerlevel10k configuration wizard on 2021-06-28 at 18:35 EDT. | |
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 19275. | |
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 12h time, | |
# 1 line, compact, many icons, concise, instant_prompt=verbose. | |
# Type `p10k configure` to generate another config. | |
# | |
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate | |
# your own config based on it. | |
# | |
# Tip: Looking for a nice color? Here's a one-liner to print colormap. |
# Author: weCryOpen (Ruyi Li) | |
function d1p1(file) | |
open(file) do f | |
total = 0 | |
for line in eachline(f) | |
# Iterate through each line in the file | |
# Convert it to an integer, | |
n = parse(Int, line) | |
# and add it to the total. |
# Author: Ruyi Li (weCryOpen) | |
function mypi(n::Int)::Float | |
total_sum::Float = 0 | |
for i = 1:n | |
total_sum += 1 / (i * i) | |
end | |
(total_sum * 6) ^ 0.5 | |
end |
<canvas></canvas> | |
<button onclick="josephus()"> Start </button> | |
<button onclick="eliminate()"> Kill </button> | |
<script> | |
const canvas = document.querySelector('canvas'); | |
const ctx = canvas.getContext('2d'); | |
const SIZE = 640; | |
canvas.width = canvas.height = SIZE; |
I hereby claim:
To claim this, I am signing this object:
g=a=>`:goose-${a}:`;[g('top'),...Array(+prompt('Length of goose neck:')).fill(g('middle')),g('bottom')].join`\n` |
<canvas style="position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);"></canvas> | |
<script> | |
/* | |
w - The width of the canvas in pixels. | |
h - The height of the canvas in pixels. | |
s - The size of the character in pixels. | |
c - The canvas element. | |
t - The graphics context. | |
u - The available colors. | |
q - The player's current colors. |
Make sure to use styles!
Rules of the game:
Each player draws five cards (either rock, paper, or scissors) from an unlimited deck. Both players will pick one card, and if one player's cards beat the other (rock beats scissors, paper beats rock, scissors beats paper) then that player wins. If there is a tie (e.g. both play rock) then whoever has more of the chosen card in the hand wins. If they both have the same amount, it is counted as a tie.
As an extra challenge, modify the game so that there are 5 rounds, with a point being awarded each time a player wins. At the end of the five rounds, print the status of the game (either a win, tie, or a loss).