useless printing refactor
This commit is contained in:
parent
c6fd13f0a4
commit
c59afecba5
|
@ -62,23 +62,19 @@ pub fn suggest(matrix: String, hold: String, next: String) -> Result<String, Str
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(format!(
|
Ok(format!(
|
||||||
"{x},{y},{r},{ty}",
|
"{},{},{},{}",
|
||||||
x = res.loc.x,
|
res.loc.x,
|
||||||
y = res.loc.y,
|
res.loc.y,
|
||||||
r = rot(res.loc.r),
|
match res.loc.r {
|
||||||
ty = res.ty
|
Rot::N => "spawn",
|
||||||
|
Rot::E => "right",
|
||||||
|
Rot::S => "reverse",
|
||||||
|
Rot::W => "left",
|
||||||
|
},
|
||||||
|
res.ty.name(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rot(r: Rot) -> &'static str {
|
|
||||||
match r {
|
|
||||||
Rot::N => "spawn",
|
|
||||||
Rot::E => "right",
|
|
||||||
Rot::S => "reverse",
|
|
||||||
Rot::W => "left",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parse_matrix(s: &str) -> MatBuf {
|
fn parse_matrix(s: &str) -> MatBuf {
|
||||||
s.bytes()
|
s.bytes()
|
||||||
.take(400)
|
.take(400)
|
||||||
|
|
Loading…
Reference in New Issue