Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,10 @@
$method = ([Math] | Get-Member -MemberType Method -Static | Where-Object {$_.Definition.Split(',').Count -eq 1} | Get-Random).Name
$number = (1..9 | Get-Random) / 10
$result = [Math]::$method($number)
$output = [PSCustomObject]@{
Method = $method
Number = $number
Result = $result
}
$output | Format-List

View file

@ -0,0 +1,21 @@
import os
struct Obj {
mut:
methods map[string]fn()
}
fn (mut o Obj) create_methods() Obj {
o.methods["ma"] = fn () { println("Method A Called") }
o.methods["mb"] = fn () { println("Method B Called") }
o.methods["mc"] = fn () { println("Method C Called") }
return o
}
fn main() {
mut obj := Obj{}
obj = obj.create_methods()
name := os.input("Which method should I call? ").str()
if name in obj.methods { obj.methods[name]() }
else { println("No method of that name found!") }
}