Skip to content

Commit

Permalink
add xit
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezatabatabaeian committed Jan 5, 2024
1 parent 0bc502c commit e4941d4
Show file tree
Hide file tree
Showing 39 changed files with 163 additions and 327 deletions.
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
"concepts": [],
"key_features": [],
"tags": [
"paradigm/logic",
"paradigm/imperative",
"paradigm/functional",
"typing/static",
"execution_mode/compiled",
"platform/windows",
Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/armstrong-numbers/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
],
"example": [
".meta/example.fc"
],
"editor": [
"contracts/imports/stdlib.fc"
],
"invalidator": [
"package.json"
]
},
"blurb": "Determine if a number is an Armstrong number.",
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/armstrong-numbers/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"singleQuote": true,
"bracketSpacing": true,
"semi": true
}
}
26 changes: 0 additions & 26 deletions exercises/practice/armstrong-numbers/README.md

This file was deleted.

3 changes: 1 addition & 2 deletions exercises/practice/armstrong-numbers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
"@types/jest": "^29.5.0",
"@types/node": "^20.2.5",
"jest": "^29.5.0",
"prettier": "^2.8.6",
"ton": "~13.6.0",
"ton-core": "^0.51.0",
"ton-crypto": "^3.2.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
}
}
}
22 changes: 11 additions & 11 deletions exercises/practice/armstrong-numbers/tests/Template.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,47 +38,47 @@ describe('Template', () => {
expect(await template.get_is_armstrong_number(0)).toBe(True);
});

it('single digit numbers are armstrong numbers', async () => {
xit('single digit numbers are armstrong numbers', async () => {
expect(await template.get_is_armstrong_number(5)).toBe(True);
});

it('there are no two digit armstrong numbers', async () => {
xit('there are no two digit armstrong numbers', async () => {
expect(await template.get_is_armstrong_number(10)).toBe(False);
});

it('three digit number that is an armstrong number', async () => {
xit('three digit number that is an armstrong number', async () => {
expect(await template.get_is_armstrong_number(153)).toBe(True);
});

it('three digit number that is not an armstrong number', async () => {
xit('three digit number that is not an armstrong number', async () => {
expect(await template.get_is_armstrong_number(100)).toBe(False);
});

it('four digit number that is an armstrong number', async () => {
xit('four digit number that is an armstrong number', async () => {
expect(await template.get_is_armstrong_number(9_474)).toBe(True);
});

it('four digit number that is not an armstrong number', async () => {
xit('four digit number that is not an armstrong number', async () => {
expect(await template.get_is_armstrong_number(9_475)).toBe(False);
});

it('seven digit number that is an armstrong number', async () => {
xit('seven digit number that is an armstrong number', async () => {
expect(await template.get_is_armstrong_number(9_926_315)).toBe(True);
});

it('seven digit number that is not an armstrong number', async () => {
xit('seven digit number that is not an armstrong number', async () => {
expect(await template.get_is_armstrong_number(9_926_314)).toBe(False);
});

it('nine digit number that is an armstrong number', async () => {
xit('nine digit number that is an armstrong number', async () => {
expect(await template.get_is_armstrong_number(912_985_153)).toBe(True);
});

it('nine digit number that is not an armstrong number', async () => {
xit('nine digit number that is not an armstrong number', async () => {
expect(await template.get_is_armstrong_number(999_999_999)).toBe(False);
});

it('ten digit number that is not an armstrong number', async () => {
xit('ten digit number that is not an armstrong number', async () => {
expect(await template.get_is_armstrong_number(3_999_999_999)).toBe(False);
});

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/binary-search/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
],
"example": [
".meta/example.fc"
],
"editor": [
"contracts/imports/stdlib.fc"
],
"invalidator": [
"package.json"
]
},
"blurb": "Implement a binary search algorithm.",
Expand Down
26 changes: 0 additions & 26 deletions exercises/practice/binary-search/README.md

This file was deleted.

1 change: 0 additions & 1 deletion exercises/practice/binary-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"@types/jest": "^29.5.0",
"@types/node": "^20.2.5",
"jest": "^29.5.0",
"prettier": "^2.8.6",
"ton": "~13.6.0",
"ton-core": "^0.51.0",
"ton-crypto": "^3.2.0",
Expand Down
20 changes: 10 additions & 10 deletions exercises/practice/binary-search/tests/Template.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,43 +35,43 @@ describe('Template', () => {
expect(await template.get_binary_search([6], 6)).toBe(0)
});

it('test finds a value in the middle of an array', async () => {
xit('test finds a value in the middle of an array', async () => {
expect(await template.get_binary_search([1, 3, 4, 6, 8, 9, 11], 6)).toBe(3)
});

it('test finds a value at the beginning of an array', async () => {
xit('test finds a value at the beginning of an array', async () => {
expect(await template.get_binary_search([1, 3, 4, 6, 8, 9, 11], 1)).toBe(0)
});

it('test finds a value at the end of an array', async () => {
xit('test finds a value at the end of an array', async () => {
expect(await template.get_binary_search([1, 3, 4, 6, 8, 9, 11], 11)).toBe(6)
});

it('test finds a value in an array of odd length', async () => {
xit('test finds a value in an array of odd length', async () => {
expect(await template.get_binary_search([1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634], 144)).toBe(9)
});

it('test finds a value in an array of even length', async () => {
xit('test finds a value in an array of even length', async () => {
expect(await template.get_binary_search([1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377], 21)).toBe(5)
});

it('test identifies that a value is not included in the array', async () => {
xit('test identifies that a value is not included in the array', async () => {
expect(await template.get_binary_search([1, 3, 4, 6, 8, 9, 11], 7)).toBe(-1)
});

it('test a value smaller than the array\'s smallest value is not found', async () => {
xit('test a value smaller than the array\'s smallest value is not found', async () => {
expect(await template.get_binary_search([1, 3, 4, 6, 8, 9, 11], 0)).toBe(-1)
});

it('test a value larger than the array\'s largest value is not found', async () => {
xit('test a value larger than the array\'s largest value is not found', async () => {
expect(await template.get_binary_search([1, 3, 4, 6, 8, 9, 11], 13)).toBe(-1)
});

it('test nothing is found in an empty array', async () => {
xit('test nothing is found in an empty array', async () => {
expect(await template.get_binary_search([], 1)).toBe(-1)
});

it('test nothing is found when the left and right bounds cross', async () => {
xit('test nothing is found when the left and right bounds cross', async () => {
expect(await template.get_binary_search([1, 2], 0)).toBe(-1)
});
});
6 changes: 6 additions & 0 deletions exercises/practice/change/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
],
"example": [
".meta/example.fc"
],
"editor": [
"contracts/imports/stdlib.fc"
],
"invalidator": [
"package.json"
]
},
"blurb": "Correctly determine change to be given using the least number of coins.",
Expand Down
26 changes: 0 additions & 26 deletions exercises/practice/change/README.md

This file was deleted.

1 change: 0 additions & 1 deletion exercises/practice/change/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"@types/jest": "^29.5.0",
"@types/node": "^20.2.5",
"jest": "^29.5.0",
"prettier": "^2.8.6",
"ton": "~13.6.0",
"ton-core": "^0.51.0",
"ton-crypto": "^3.2.0",
Expand Down
23 changes: 11 additions & 12 deletions exercises/practice/change/tests/Template.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,39 @@ describe('Template', () => {
expect(await template.get_find_fewest_coins([1, 5, 10, 25], 1)).toStrictEqual([1])
});

it('test single coin change', async () => {
xit('test single coin change', async () => {
expect(await template.get_find_fewest_coins([1, 5, 10, 25, 100], 25)).toStrictEqual([25])
});

it('test multiple coin change', async () => {
xit('test multiple coin change', async () => {
expect(await template.get_find_fewest_coins([1, 5, 10, 25, 100], 15)).toStrictEqual([5, 10])
});

it('test change with lilliputian coins', async () => {
xit('test change with lilliputian coins', async () => {
expect(await template.get_find_fewest_coins([1, 4, 15, 20, 50], 23)).toStrictEqual([4, 4, 15])
});

it('test change with lower elbonia coins', async () => {
xit('test change with lower elbonia coins', async () => {
expect(await template.get_find_fewest_coins([1, 5, 10, 21, 25], 63)).toStrictEqual([21, 21, 21])
});

it('test large target values', async () => {
// there were some problems with gas usage so, I've modified the test
xit('test large target values', async () => {
expect(await template.get_find_fewest_coins([1, 2, 5, 10, 20, 50, 100], 49)).toStrictEqual([2, 2, 5, 20, 20])
});

it('test possible change without unit coins available', async () => {
xit('test possible change without unit coins available', async () => {
expect(await template.get_find_fewest_coins([2, 5, 10, 20, 50], 21)).toStrictEqual([2, 2, 2, 5, 10])
});

it('test another possible change without unit coins available', async () => {
xit('test another possible change without unit coins available', async () => {
expect(await template.get_find_fewest_coins([4, 5], 27)).toStrictEqual([4, 4, 4, 5, 5, 5])
});

it('test no coins make 0 change', async () => {
xit('test no coins make 0 change', async () => {
expect(await template.get_find_fewest_coins([1, 5, 10, 21, 25], 0)).toStrictEqual([])
});

it('test error testing for change smaller than the smallest of coins', async () => {
xit('test error testing for change smaller than the smallest of coins', async () => {
try {
await template.get_find_fewest_coins([5, 10], 3);
} catch (error) {
Expand All @@ -81,7 +80,7 @@ describe('Template', () => {
}
});

it('test error if no combination can add up to target', async () => {
xit('test error if no combination can add up to target', async () => {
try {
await template.get_find_fewest_coins([5, 10], 94);
} catch (error) {
Expand All @@ -94,7 +93,7 @@ describe('Template', () => {
}
});

it('test cannot find negative change values', async () => {
xit('test cannot find negative change values', async () => {
try {
await template.get_find_fewest_coins([1, 2, 5], -5);
} catch (error) {
Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/difference-of-squares/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
],
"example": [
".meta/example.fc"
],
"editor": [
"contracts/imports/stdlib.fc"
],
"invalidator": [
"package.json"
]
},
"blurb": "Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.",
Expand Down
26 changes: 0 additions & 26 deletions exercises/practice/difference-of-squares/README.md

This file was deleted.

1 change: 0 additions & 1 deletion exercises/practice/difference-of-squares/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"@types/jest": "^29.5.0",
"@types/node": "^20.2.5",
"jest": "^29.5.0",
"prettier": "^2.8.6",
"ton": "~13.6.0",
"ton-core": "^0.51.0",
"ton-crypto": "^3.2.0",
Expand Down
Loading

0 comments on commit e4941d4

Please sign in to comment.