diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..00ca6ac --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,45 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug executable 'rixelflood'", + "cargo": { + "args": [ + "build", + "--bin=rixelflood", + "--package=rixelflood" + ], + "filter": { + "name": "rixelflood", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}", + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in executable 'rixelflood'", + "cargo": { + "args": [ + "test", + "--no-run", + "--bin=rixelflood", + "--package=rixelflood" + ], + "filter": { + "name": "rixelflood", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}", + } + ] +} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..7526830 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "rixelflood" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..5a9c1ee --- /dev/null +++ b/src/main.rs @@ -0,0 +1,20 @@ +use std::{io::Write, net::TcpStream}; + +fn main() { + println!("Hello, world!"); + let mut stream = TcpStream::connect("192.168.1.29:8080").unwrap(); + //stream.set_nonblocking(true).unwrap(); + + println!("{}", std::env::var("TESTVAR").expect("Variable not defined")); + + loop { + for x in 100..201 { + for y in 100..201 { + let send_string = format!("PX {:?} {:?} ff0000\n", x, y); + let buffer = send_string.as_bytes(); + stream.write(&buffer).unwrap(); + stream.flush().unwrap(); + } + } + } +}