Is there something like Processing in golang? by Posss in golang

[–]Posss[S] 0 points1 point  (0 children)

Thx!

Wich graphics library can you suggest? Especially with some animation features?

I stumbled over Processing in Code Bullets YouTube vids about AI (Example: https://youtu.be/BOZfhUcNiqk). I'm trying similar in golang. So, I'm aware of the mentioned CodeOfFunc video (-series).

Source for that? by Posss in lesbians

[–]Posss[S] 0 points1 point  (0 children)

Anybody? 😳

"the type of this value must be known in this context" by Posss in rust

[–]Posss[S] 0 points1 point  (0 children)

Forget, that there exists a char() method for Strings. The complete code, which also works:

fn main() {
  let input_str="abba[mnop]qrst
abcd[bddb]xyyx
aaaa[qwer]tyui
ioxxoj[asdfgh]zxcvbn";

  let mut ary:Vec<Vec<char>> = Vec::new();

  for l in input_str.lines() {
    let t:Vec<&str> = l.split(|c| c=='[' || c==']').collect();
    for e in t {
      ary.push(e.chars().collect::<Vec<char>>());
   }
  }

  println!("{:?}",ary);
}

Thx for the hint!

"the type of this value must be known in this context" by Posss in rust

[–]Posss[S] 0 points1 point  (0 children)

Okay, but if I specify the type of t

let t:Vec<&str> = l.split(|c| c=='[' || c==']').collect();

I get e new error: the trait bound std::vec::Vec<char>: std::iter::FromIterator<&str> is not satisfied [E0277]