Skip to main content
added 76 characters in body
Source Link
Saphereye
  • 517
  • 3
  • 8

Rust, 4747 45 bytes

|s:&str|{for&str|for i in s.bytes(){print!("{:b} ",i)}}

Try it online!Try it online!

A closure iterating over the string, converting each character to its ascii number, then printing out it's binary equivalent with :b

Turns out you don't need {} always to define a closure

Rust, 47 bytes

|s:&str|{for i in s.bytes(){print!("{:b} ",i)}}

Try it online!

A closure iterating over the string, converting each character to its ascii number, then printing out it's binary equivalent with :b

Rust, 47 45 bytes

|s:&str|for i in s.bytes(){print!("{:b} ",i)}

Try it online!

A closure iterating over the string, converting each character to its ascii number, then printing out it's binary equivalent with :b

Turns out you don't need {} always to define a closure

Source Link
Saphereye
  • 517
  • 3
  • 8

Rust, 47 bytes

|s:&str|{for i in s.bytes(){print!("{:b} ",i)}}

Try it online!

A closure iterating over the string, converting each character to its ascii number, then printing out it's binary equivalent with :b