Commit 254dd9dd authored by Chris Prince's avatar Chris Prince

Fix errors

parent 5b649572
...@@ -73,19 +73,19 @@ void moveLaser(int x, int y) { ...@@ -73,19 +73,19 @@ void moveLaser(int x, int y) {
void moveRequest(String req) { void moveRequest(String req) {
int x; int x;
int y; int y;
const paramQIdx = req.indexOf('?'); const int paramQIdx = req.indexOf('?');
const paramAtIdx = req.indexOf('&'); const int paramAtIdx = req.indexOf('&');
const String valA = req.substring(paramQIdx + 1, paramAtIdx); const String valA = req.substring(paramQIdx + 1, paramAtIdx);
const String valB = req.substring(paramAtIdx+1); const String valB = req.substring(paramAtIdx+1);
if (valA.startsWith('x=') && valA.length < 6) { if (valA.startsWith('x=') && valA.length < 6) {
string tmpX = valA.substring(2); String tmpX = valA.substring(2);
string tmpY = valB.substring(2); String tmpY = valB.substring(2);
x = tmpX.toInt(); x = tmpX.toInt();
y = tmpY.toInt(); y = tmpY.toInt();
} else { } else {
string tmpY = valA.substring(2); String tmpY = valA.substring(2);
string tmpX = valB.substring(2); String tmpX = valB.substring(2);
x = tmpX.toInt(); x = tmpX.toInt();
y = tmpY.toInt(); y = tmpY.toInt();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment