From 9f72cfad76d6569cc6a4eabc308fb6f3d7b414f6 Mon Sep 17 00:00:00 2001 From: Stagg Jacob Date: Sat, 30 Oct 2021 17:09:37 -0400 Subject: [PATCH] Completed lab --- TooLargeTooSmall.java | 14 +++++++++++++- package.bluej | 30 ++++++++++++++++++------------ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/TooLargeTooSmall.java b/TooLargeTooSmall.java index 4d45abf..b83221c 100644 --- a/TooLargeTooSmall.java +++ b/TooLargeTooSmall.java @@ -17,8 +17,20 @@ public TooLargeTooSmall(Integer seed) { } public Integer guess(Integer g) { + int result = 0; + + if (g < chosenNum) { + result = -1; + return result; + } else if (g == chosenNum) { + result = 0; + return result; + } else if (g > chosenNum) { + result = 1; + return result; + } + System.out.println(result + ", " + chosenNum + ", " + g); return chosenNum; - } } \ No newline at end of file diff --git a/package.bluej b/package.bluej index abc5ce7..4f70f30 100644 --- a/package.bluej +++ b/package.bluej @@ -4,26 +4,26 @@ dependency1.to=TooLargeTooSmall dependency1.type=UsesDependency editor.fx.0.height=767 editor.fx.0.width=1150 -editor.fx.0.x=448 -editor.fx.0.y=120 -objectbench.height=101 -objectbench.width=461 +editor.fx.0.x=290 +editor.fx.0.y=75 +objectbench.height=100 +objectbench.width=776 package.divider.horizontal=0.6 -package.divider.vertical=0.8007380073800738 -package.editor.height=427 -package.editor.width=674 -package.editor.x=220 -package.editor.y=143 +package.divider.vertical=0.8003731343283582 +package.editor.height=422 +package.editor.width=683 +package.editor.x=331 +package.editor.y=109 package.frame.height=600 package.frame.width=800 package.numDependencies=1 -package.numTargets=2 +package.numTargets=3 package.showExtends=true package.showUses=true project.charset=UTF-8 -readme.height=58 +readme.height=60 readme.name=@README -readme.width=47 +readme.width=48 readme.x=10 readme.y=10 target1.association=TooLargeTooSmallTest @@ -41,3 +41,9 @@ target2.type=UnitTestTargetJunit4 target2.width=140 target2.x=160 target2.y=120 +target3.height=70 +target3.name=README.md +target3.type=TextTarget +target3.width=120 +target3.x=70 +target3.y=10