From c6d018acef04a8596cdc976d2fb02e86ccd1fb08 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Tue, 12 Apr 2022 17:51:18 +1000 Subject: [PATCH] Fix 0 shot for new defense --- 07_Basketball/csharp/Shot.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/07_Basketball/csharp/Shot.cs b/07_Basketball/csharp/Shot.cs index 94ff9b84..fb7c2f3e 100644 --- a/07_Basketball/csharp/Shot.cs +++ b/07_Basketball/csharp/Shot.cs @@ -15,12 +15,13 @@ public class Shot { // Although the game instructions reference two different jump shots, // the original game code treats them both the same and just prints "Jump shot" + 0 => null, <= 2 => new JumpShot(), 3 => new Shot("Lay up"), 4 => new Shot("Set shot"), _ => null }; - return shot is not null; + return shotNumber == 0 || shot is not null; } public static Shot Get(float shotNumber) =>