Tupper's self-referential formula: Difference between revisions

Content added Content deleted
m (→‎{{header|Rust}}: formatting)
Line 340: Line 340:


/// Tupper function value maxtrix for graphic
/// Tupper function value maxtrix for graphic
fn tupper_mat(kconst: BigInt) -> Vec<[bool; 106]> {
fn tuppermat(kconst: BigInt) -> Vec<[bool; 106]> {
let mut tmatrix = vec![[true; 106]; 17];
let mut tmatrix = vec![[true; 106]; 17];
let bigone: BigInt = BigInt::from_u32(1).unwrap();
let bigone: BigInt = BigInt::from_u32(1).unwrap();
Line 360: Line 360:


fn main() {
fn main() {
let k: BigInt = BigInt::parse_bytes(b"960939379918958884971672962127852754715004339660129306651505519271702802395266424689642842174350718121267153782770623355993237280874144307891325963941337723487857735749823926629715517173716995165232890538221612403238855866184013235585136048828693337902491454229288667081096184496091705183454067827731551705405381627380967602565625016981482083418783163849115590225610003652351370343874461848378737238198224849863465033159410054974700593138339226497249461751545728366702369745461014655997933798537483143786841806593422227898388722980000748404719",
let k: BigInt = BigInt::parse_bytes(b"960939379918958884971672962127852754715004339660129306651505519_271_702_802_395_266_424_689_642_842_174_350_718_121_267_153_782_770_623_355993_237_280_874_144_307_891_325_963_941_337_723_487_857_735_749_823_926_629_715517_173_716_995_165_232_890_538_221_612_403_238_855_866_184_013_235_585_136_048828_693_337_902_491_454_229_288_667_081_096_184_496_091_705_183_454_067_827_731551_705_405_381_627_380_967_602_565_625_016_981_482_083_418_783_163_849_115_590225_610_003_652_351_370_343_874_461_848_378_737_238_198_224_849_863_465_033_159410_054_974_700_593_138_339_226_497_249_461_751_545_728_366_702_369_745_461_014655_997_933_798_537_483_143_786_841_806_593_422_227_898_388_722_980_000_748_404_719",
10).unwrap();
10).unwrap();
let bmap = tupper_mat(k);
let bmap = tuppermat(k);
for line in bmap.iter().rev() {
for line in bmap.iter().rev() {
for c in line.iter() {
for c in line.iter() {
if *c {
if *c {
print!("\u{25A0}");
print!("\u{2588}");
}
}
else {
else {