generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 262
Glasgow | 25-ITP-Sep | Fares Bakhet | Sprint 3 | coursework/sprint-3-implement-and-rewrite #755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Fares-Bakhet
wants to merge
11
commits into
CodeYourFuture:main
Choose a base branch
from
Fares-Bakhet:coursework/sprint-3-implement-and-rewrite
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8738ad1
Editing the getAngleType Code
Fares-Bakhet ed40750
Editing isProoerFraction Code
Fares-Bakhet e6d384c
Editing getCardValue Code
Fares-Bakhet a2b2e06
Passed the test for getAngleType code
Fares-Bakhet 11efcb1
Passed getCardvalue test
Fares-Bakhet d440aaf
Passed isProperFraction test
Fares-Bakhet 07685f8
Deleted angle>90
Fares-Bakhet 283fe06
Editing the code
Fares-Bakhet 7139e24
Generalise test case3
Fares-Bakhet 29b1e29
Editing
Fares-Bakhet 4c6b2b2
Re-write the tests
Fares-Bakhet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,17 +13,12 @@ test("should return 5 for Five of Hearts", () => { | |
| expect(fiveofHearts).toEqual(5); | ||
| }); | ||
| // Case 3: Handle Face Cards (J, Q, K): | ||
| test("should return 10 for Jack of Diamonds", () => { | ||
| const jackofDiamonds = getCardValue("J♦"); | ||
| expect(jackofDiamonds).toEqual(10); | ||
| }); | ||
| test("should return 10 for Queen of Clubs", () => { | ||
| const queenofClubs = getCardValue("Q♣"); | ||
| expect(queenofClubs).toEqual(10); | ||
| }); | ||
| test("should return 10 for King of Hearts", () => { | ||
| const kingofHearts = getCardValue("K♥"); | ||
| expect(kingofHearts).toEqual(10); | ||
| test("should return 10 for all face cards (J, Q, K)", () => { | ||
| const faceCards = ["J♦", "Q♣", "K♥"]; | ||
| faceCards.forEach((card) => { | ||
| const value = getCardValue(card); | ||
| expect(value).toEqual(10); | ||
| }); | ||
| }); | ||
|
||
| // Case 4: Handle Ace (A): | ||
| test("should return 11 for Ace of Spades", () => { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you find all places where you can remove redundant checks and update the code accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjyuan, okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjyuan,
If I want to rearrange this again, I will end up in this way:
Right??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't tell.
180 & < 360is not exactly JS code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjyuan,
I was shortcutting
if( angle > 180 && angle <360)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't know wat you try to expressed:

I suspect part of the code is misinterpreted as Markdown code. Here is the GitHub Markdown guide:
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax