Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Last active June 16, 2017 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssaurel/3069362732cf6614fa038063cd53bcc2 to your computer and use it in GitHub Desktop.
Save ssaurel/3069362732cf6614fa038063cd53bcc2 to your computer and use it in GitHub Desktop.
Add Operation for the Countdown Math Game on the SSaurel's Channel
package com.ssaurel.countdowngame;
public class Add implements Operation {
@Override
public int eval(int x, int y) {
int r = x + y;
if (r <= x || r <= y) {
return 0;
} else {
return r;
}
}
@Override
public String symbol() {
return "+";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment