Skip to content

Commit

Permalink
make Lecture10 readme source code comments japanese
Browse files Browse the repository at this point in the history
  • Loading branch information
PolymetisOutis committed Jul 28, 2024
1 parent 3d535a4 commit fc66fb2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Languages/ja/10_InsertionSort_ja/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ function doWhileTest() public pure returns(uint256){
この演算子は`if-else`文の代替として頻繁に使用されます。

```solidity
// ternary/conditional operator
// ternary/conditional operator(三項演算子/条件演算子)
function ternaryTest(uint256 x, uint256 y) public pure returns(uint256){
// return the max of x and y
// return the max of x and y(xとyの最大値を返す)
return x >= y ? x: y;
}
```
Expand All @@ -104,7 +104,7 @@ function ternaryTest(uint256 x, uint256 y) public pure returns(uint256){
それでは、挿入ソートのPythonでの実装を見てみましょう:

```python
# Python program for implementation of Insertion Sort
# Python program for implementation of Insertion Sort(挿入ソートを実装するPythonのプログラミング)
def insertionSort(arr):
for i in range(1, len(arr)):
key = arr[i]
Expand All @@ -122,7 +122,7 @@ Python版の挿入ソートは9行を要します。`function`や`variables`、
たったの9行のコードで出来ます:

``` solidity
// Insertion Sort (Wrong version)
// Insertion Sort (Wrong version)(挿入ソート(間違いバージョン))
function insertionSortWrong(uint[] memory a) public pure returns(uint[] memory) {
for (uint i = 1;i < a.length;i++){
uint temp = a[i];
Expand Down Expand Up @@ -150,9 +150,9 @@ Python版の挿入ソートは9行を要します。`function`や`variables`、
ですので、`j`が決して負の値を取ることが無いように、我々は`j``1`を加える必要があるのです。正確な挿入ソートのsolidityのコードは次のようになります:

```solidity
// Insertion Sort(Correct Version)
// Insertion Sort(Correct Version)(挿入ソート(正確なバージョン))
function insertionSort(uint[] memory a) public pure returns(uint[] memory) {
// note that uint can not take negative value
// note that uint can not take negative value(uint型は負の数を取れないことに注意すること)
for (uint i = 1;i < a.length;i++){
uint temp = a[i];
uint j=i;
Expand Down

0 comments on commit fc66fb2

Please sign in to comment.