diff --git a/subjects/bezero/README.md b/subjects/bezero/README.md index 4e646327..44950f1e 100644 --- a/subjects/bezero/README.md +++ b/subjects/bezero/README.md @@ -23,12 +23,11 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.BeZero([]int{1, 2, 3, 4, 5, 6})) - fmt.Println(piscine.BeZero([]int{})) + fmt.Println(BeZero([]int{1, 2, 3, 4, 5, 6})) + fmt.Println(BeZero([]int{})) } ``` diff --git a/subjects/byebyefirst/README.md b/subjects/byebyefirst/README.md index 6595a38b..6854c8a6 100644 --- a/subjects/byebyefirst/README.md +++ b/subjects/byebyefirst/README.md @@ -23,15 +23,13 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Println(piscine.ByeByeFirst([]string{})) - fmt.Println(piscine.ByeByeFirst([]string{"one arg"})) - fmt.Println(piscine.ByeByeFirst([]string{"first", "second"})) - fmt.Println(piscine.ByeByeFirst([]string{"", "abcd", "efg"})) + fmt.Println(ByeByeFirst([]string{})) + fmt.Println(ByeByeFirst([]string{"one arg"})) + fmt.Println(ByeByeFirst([]string{"first", "second"})) + fmt.Println(ByeByeFirst([]string{"", "abcd", "efg"})) } ``` diff --git a/subjects/cameltosnakecase/README.md b/subjects/cameltosnakecase/README.md index 41d63f1c..a89d85d1 100644 --- a/subjects/cameltosnakecase/README.md +++ b/subjects/cameltosnakecase/README.md @@ -36,17 +36,15 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Println(piscine.CamelToSnakeCase("HelloWorld")) - fmt.Println(piscine.CamelToSnakeCase("helloWorld")) - fmt.Println(piscine.CamelToSnakeCase("camelCase")) - fmt.Println(piscine.CamelToSnakeCase("CAMELtoSnackCASE")) - fmt.Println(piscine.CamelToSnakeCase("camelToSnakeCase")) - fmt.Println(piscine.CamelToSnakeCase("hey2")) + fmt.Println(CamelToSnakeCase("HelloWorld")) + fmt.Println(CamelToSnakeCase("helloWorld")) + fmt.Println(CamelToSnakeCase("camelCase")) + fmt.Println(CamelToSnakeCase("CAMELtoSnackCASE")) + fmt.Println(CamelToSnakeCase("camelToSnakeCase")) + fmt.Println(CamelToSnakeCase("hey2")) } ``` diff --git a/subjects/checknumber/README.md b/subjects/checknumber/README.md index c6487479..573cb683 100644 --- a/subjects/checknumber/README.md +++ b/subjects/checknumber/README.md @@ -17,14 +17,16 @@ Here is a possible program to test your function: ```go package main + import ( "fmt" - "piscine" ) + func main() { - fmt.Println(piscine.CheckNumber("Hello")) - fmt.Println(piscine.CheckNumber("Hello1")) + fmt.Println(CheckNumber("Hello")) + fmt.Println(CheckNumber("Hello1")) } + ``` And its output: diff --git a/subjects/concatalternate/README.md b/subjects/concatalternate/README.md index 83b392b6..42e69f65 100644 --- a/subjects/concatalternate/README.md +++ b/subjects/concatalternate/README.md @@ -3,6 +3,7 @@ ### Instructions Write a function `ConcatAlternate()` that receives two slices of an `int` as arguments and returns a new slice with the result of the alternated values of each slice. + - The input slices can be of different lengths. - The new slice should start with an element of the largest slice. - If the slices are of equal length, the new slice should return the elements of the first slice first and then the elements of the second slice. @@ -24,14 +25,13 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.ConcatAlternate([]int{1, 2, 3}, []int{4, 5, 6})) - fmt.Println(piscine.ConcatAlternate([]int{2, 4, 6, 8, 10}, []int{1, 3, 5, 7, 9, 11})) - fmt.Println(piscine.ConcatAlternate([]int{1, 2, 3}, []int{4, 5, 6, 7, 8, 9})) - fmt.Println(piscine.ConcatAlternate([]int{1, 2, 3}, []int{})) + fmt.Println(ConcatAlternate([]int{1, 2, 3}, []int{4, 5, 6})) + fmt.Println(ConcatAlternate([]int{2, 4, 6, 8, 10}, []int{1, 3, 5, 7, 9, 11})) + fmt.Println(ConcatAlternate([]int{1, 2, 3}, []int{4, 5, 6, 7, 8, 9})) + fmt.Println(ConcatAlternate([]int{1, 2, 3}, []int{})) } ``` diff --git a/subjects/concatslice/README.md b/subjects/concatslice/README.md index 96e15881..c902d486 100644 --- a/subjects/concatslice/README.md +++ b/subjects/concatslice/README.md @@ -21,13 +21,12 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.ConcatSlice([]int{1, 2, 3}, []int{4, 5, 6})) - fmt.Println(piscine.ConcatSlice([]int{}, []int{4, 5, 6, 7, 8, 9})) - fmt.Println(piscine.ConcatSlice([]int{1, 2, 3}, []int{})) + fmt.Println(ConcatSlice([]int{1, 2, 3}, []int{4, 5, 6})) + fmt.Println(ConcatSlice([]int{}, []int{4, 5, 6, 7, 8, 9})) + fmt.Println(ConcatSlice([]int{1, 2, 3}, []int{})) } ``` diff --git a/subjects/countalpha/README.md b/subjects/countalpha/README.md index b8bb5885..84e60060 100644 --- a/subjects/countalpha/README.md +++ b/subjects/countalpha/README.md @@ -21,14 +21,12 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Println(piscine.CountAlpha("Hello world")) - fmt.Println(piscine.CountAlpha("H e l l o")) - fmt.Println(piscine.CountAlpha("H1e2l3l4o")) + fmt.Println(CountAlpha("Hello world")) + fmt.Println(CountAlpha("H e l l o")) + fmt.Println(CountAlpha("H1e2l3l4o")) } ``` diff --git a/subjects/countcharacter/README.md b/subjects/countcharacter/README.md index 418c59ac..d14f9753 100644 --- a/subjects/countcharacter/README.md +++ b/subjects/countcharacter/README.md @@ -1,7 +1,9 @@ ## count-character ### Instructions + write a function that takes a string and a character as arguments and returns the number of times the character appears in the string. + - if the character is not in the string return 0 - if the string is empty return 0 @@ -20,17 +22,17 @@ Here is a possible program to test your function: ```go package main -import ( - "fmt" - "piscine" +import ( + "fmt" ) func main() { - fmt.Println(piscine.CountChar("Hello World", 'l')) - fmt.Println(piscine.CountChar("5 balloons",5)) - fmt.Println(piscine.CountChar(" ", ' ')) - fmt.Println(piscine.CountChar("The 7 deadly sins", '7')) + fmt.Println(CountChar("Hello World", 'l')) + fmt.Println(CountChar("5 balloons", 5)) + fmt.Println(CountChar(" ", ' ')) + fmt.Println(CountChar("The 7 deadly sins", '7')) } + ``` And its output : @@ -42,4 +44,3 @@ $ go run . 1 1 ``` - diff --git a/subjects/digitlen/README.md b/subjects/digitlen/README.md index b85dc5db..f8d3acaa 100644 --- a/subjects/digitlen/README.md +++ b/subjects/digitlen/README.md @@ -24,14 +24,13 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.DigitLen(100, 10)) - fmt.Println(piscine.DigitLen(100, 2)) - fmt.Println(piscine.DigitLen(-100, 16)) - fmt.Println(piscine.DigitLen(100, -1)) + fmt.Println(DigitLen(100, 10)) + fmt.Println(DigitLen(100, 2)) + fmt.Println(DigitLen(-100, 16)) + fmt.Println(DigitLen(100, -1)) } ``` diff --git a/subjects/fifthandskip/README.md b/subjects/fifthandskip/README.md index 6aa52e77..334b47a8 100644 --- a/subjects/fifthandskip/README.md +++ b/subjects/fifthandskip/README.md @@ -25,13 +25,12 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Print(piscine.FifthAndSkip("abcdefghijklmnopqrstuwxyz")) - fmt.Print(piscine.FifthAndSkip("This is a short sentence")) - fmt.Print(piscine.FifthAndSkip("1234")) + fmt.Print(FifthAndSkip("abcdefghijklmnopqrstuwxyz")) + fmt.Print(FifthAndSkip("This is a short sentence")) + fmt.Print(FifthAndSkip("1234")) } ``` diff --git a/subjects/fishandchips/README.md b/subjects/fishandchips/README.md index c705ef81..e3da4781 100644 --- a/subjects/fishandchips/README.md +++ b/subjects/fishandchips/README.md @@ -27,13 +27,12 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.FishAndChips(4)) - fmt.Println(piscine.FishAndChips(9)) - fmt.Println(piscine.FishAndChips(6)) + fmt.Println(FishAndChips(4)) + fmt.Println(FishAndChips(9)) + fmt.Println(FishAndChips(6)) } ``` diff --git a/subjects/fromto/README.md b/subjects/fromto/README.md index a3998928..0b9fc212 100644 --- a/subjects/fromto/README.md +++ b/subjects/fromto/README.md @@ -26,14 +26,13 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Print(piscine.FromTo(1, 10)) - fmt.Print(piscine.FromTo(10, 1)) - fmt.Print(piscine.FromTo(10, 10)) - fmt.Print(piscine.FromTo(100, 10)) + fmt.Print(FromTo(1, 10)) + fmt.Print(FromTo(10, 1)) + fmt.Print(FromTo(10, 10)) + fmt.Print(FromTo(100, 10)) } ``` diff --git a/subjects/halfslice/README.md b/subjects/halfslice/README.md index 07e2e4a8..617ad03d 100644 --- a/subjects/halfslice/README.md +++ b/subjects/halfslice/README.md @@ -21,12 +21,11 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.HalfSlice([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) - fmt.Println(piscine.HalfSlice([]int{1, 2, 3})) + fmt.Println(HalfSlice([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) + fmt.Println(HalfSlice([]int{1, 2, 3})) } ``` diff --git a/subjects/hashcode/README.md b/subjects/hashcode/README.md index 865ac8e3..16ca433b 100644 --- a/subjects/hashcode/README.md +++ b/subjects/hashcode/README.md @@ -23,15 +23,16 @@ Here is a possible program to test your function: ```go package main + import ( "fmt" - "piscine" ) + func main() { - fmt.Println(piscine.HashCode("A")) - fmt.Println(piscine.HashCode("AB")) - fmt.Println(piscine.HashCode("BAC")) - fmt.Println(piscine.HashCode("Hello World")) + fmt.Println(HashCode("A")) + fmt.Println(HashCode("AB")) + fmt.Println(HashCode("BAC")) + fmt.Println(HashCode("Hello World")) } ``` diff --git a/subjects/iscapitalized/README.md b/subjects/iscapitalized/README.md index edf8caf0..0586b6e5 100644 --- a/subjects/iscapitalized/README.md +++ b/subjects/iscapitalized/README.md @@ -24,16 +24,15 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.IsCapitalized("Hello! How are you?")) - fmt.Println(piscine.IsCapitalized("Hello How Are You")) - fmt.Println(piscine.IsCapitalized("Whats 4this 100K?")) - fmt.Println(piscine.IsCapitalized("Whatsthis4")) - fmt.Println(piscine.IsCapitalized("!!!!Whatsthis4")) - fmt.Println(piscine.IsCapitalized("")) + fmt.Println(IsCapitalized("Hello! How are you?")) + fmt.Println(IsCapitalized("Hello How Are You")) + fmt.Println(IsCapitalized("Whats 4this 100K?")) + fmt.Println(IsCapitalized("Whatsthis4")) + fmt.Println(IsCapitalized("!!!!Whatsthis4")) + fmt.Println(IsCapitalized("")) } ``` diff --git a/subjects/issamestring/README.md b/subjects/issamestring/README.md index 415655a0..401bb3e9 100644 --- a/subjects/issamestring/README.md +++ b/subjects/issamestring/README.md @@ -23,13 +23,12 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.IsSameString("hello world!", "HELLO WORLD!")) - fmt.Println(piscine.IsSameString("0101 is awesome", "0101 is AWESOME")) - fmt.Println(piscine.IsSameString("foo baz", "foo bar")) + fmt.Println(IsSameString("hello world!", "HELLO WORLD!")) + fmt.Println(IsSameString("0101 is awesome", "0101 is AWESOME")) + fmt.Println(IsSameString("foo baz", "foo bar")) } ``` diff --git a/subjects/issorted/README.md b/subjects/issorted/README.md index b31efbac..9db37ef7 100644 --- a/subjects/issorted/README.md +++ b/subjects/issorted/README.md @@ -25,15 +25,14 @@ package main import ( "fmt" - "piscine" ) func main() { a1 := []int{0, 1, 2, 3, 4, 5} a2 := []int{0, 2, 1, 3} - result1 := piscine.IsSorted(f, a1) - result2 := piscine.IsSorted(f, a2) + result1 := IsSorted(f, a1) + result2 := IsSorted(f, a2) fmt.Println(result1) fmt.Println(result2) diff --git a/subjects/multorsum/README.md b/subjects/multorsum/README.md index 6e68684f..8fc7a3a7 100644 --- a/subjects/multorsum/README.md +++ b/subjects/multorsum/README.md @@ -27,14 +27,12 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Println(piscine.MultOrSum([]int{1, 2, 3, 4}, 3)) - fmt.Println(piscine.MultOrSum([]int{1, 2, 3, 4}, 0)) - fmt.Println(piscine.MultOrSum([]int{1, -2, 3, 4}, 0)) + fmt.Println(MultOrSum([]int{1, 2, 3, 4}, 3)) + fmt.Println(MultOrSum([]int{1, 2, 3, 4}, 0)) + fmt.Println(MultOrSum([]int{1, -2, 3, 4}, 0)) } ``` diff --git a/subjects/printifnot/README.md b/subjects/printifnot/README.md index 215c23de..2ffb39bd 100644 --- a/subjects/printifnot/README.md +++ b/subjects/printifnot/README.md @@ -23,15 +23,13 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Print(piscine.PrintIfNot("abcdefz")) - fmt.Print(piscine.PrintIfNot("abc")) - fmt.Print(piscine.PrintIfNot("")) - fmt.Print(piscine.PrintIfNot("14")) + fmt.Print(PrintIfNot("abcdefz")) + fmt.Print(PrintIfNot("abc")) + fmt.Print(PrintIfNot("")) + fmt.Print(PrintIfNot("14")) } ``` diff --git a/subjects/quarterofayear/README.md b/subjects/quarterofayear/README.md index 2ab8cfe5..d8218f1b 100644 --- a/subjects/quarterofayear/README.md +++ b/subjects/quarterofayear/README.md @@ -6,7 +6,6 @@ Write a function `QuarterOfAYear()` that takes an `int`, from 1 to 12, as an arg - If the number is not between 1 and 12 return `-1`. - ### Expected function ```go @@ -24,17 +23,17 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.QuarterOfAYear(2)) - fmt.Println(piscine.QuarterOfAYear(5)) - fmt.Println(piscine.QuarterOfAYear(9)) - fmt.Println(piscine.QuarterOfAYear(11)) - fmt.Println(piscine.QuarterOfAYear(13)) - fmt.Println(piscine.QuarterOfAYear(-5)) + fmt.Println(QuarterOfAYear(2)) + fmt.Println(QuarterOfAYear(5)) + fmt.Println(QuarterOfAYear(9)) + fmt.Println(QuarterOfAYear(11)) + fmt.Println(QuarterOfAYear(13)) + fmt.Println(QuarterOfAYear(-5)) } + ``` And its output: diff --git a/subjects/rectperimeter/README.md b/subjects/rectperimeter/README.md index ce488d00..ecec70bd 100644 --- a/subjects/rectperimeter/README.md +++ b/subjects/rectperimeter/README.md @@ -23,14 +23,12 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Println(piscine.RectPerimeter(10, 2)) - fmt.Println(piscine.RectPerimeter(434343, 898989)) - fmt.Println(piscine.RectPerimeter(10, -2)) + fmt.Println(RectPerimeter(10, 2)) + fmt.Println(RectPerimeter(434343, 898989)) + fmt.Println(RectPerimeter(10, -2)) } ``` diff --git a/subjects/removeduplicate/README.md b/subjects/removeduplicate/README.md index e652a6d8..90aaac05 100644 --- a/subjects/removeduplicate/README.md +++ b/subjects/removeduplicate/README.md @@ -23,14 +23,12 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Println(piscine.RemoveDuplicate([]int{1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10})) - fmt.Println(piscine.RemoveDuplicate([]int{1, 1, 2, 2, 3})) - fmt.Println(piscine.RemoveDuplicate([]int{})) + fmt.Println(RemoveDuplicate([]int{1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10})) + fmt.Println(RemoveDuplicate([]int{1, 1, 2, 2, 3})) + fmt.Println(RemoveDuplicate([]int{})) } ``` diff --git a/subjects/retainfirsthalf/README.md b/subjects/retainfirsthalf/README.md index 244fe10c..65de86e8 100644 --- a/subjects/retainfirsthalf/README.md +++ b/subjects/retainfirsthalf/README.md @@ -25,14 +25,13 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(solutions.RetainFirstHalf("This is the 1st halfThis is the 2nd half")) - fmt.Println(solutions.RetainFirstHalf("A")) - fmt.Println(solutions.RetainFirstHalf("")) - fmt.Println(solutions.RetainFirstHalf("Hello World")) + fmt.Println(RetainFirstHalf("This is the 1st halfThis is the 2nd half")) + fmt.Println(RetainFirstHalf("A")) + fmt.Println(RetainFirstHalf("")) + fmt.Println(RetainFirstHalf("Hello World")) } ``` diff --git a/subjects/revconcatalternate/README.md b/subjects/revconcatalternate/README.md index 6fcad74f..c1547ee9 100644 --- a/subjects/revconcatalternate/README.md +++ b/subjects/revconcatalternate/README.md @@ -27,14 +27,13 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.RevConcatAlternate([]int{1, 2, 3}, []int{4, 5, 6})) - fmt.Println(piscine.RevConcatAlternate([]int{1, 2, 3}, []int{4, 5, 6, 7, 8, 9})) - fmt.Println(piscine.RevConcatAlternate([]int{1, 2, 3, 9, 8}, []int{4, 5})) - fmt.Println(piscine.RevConcatAlternate([]int{1, 2, 3}, []int{})) + fmt.Println(RevConcatAlternate([]int{1, 2, 3}, []int{4, 5, 6})) + fmt.Println(RevConcatAlternate([]int{1, 2, 3}, []int{4, 5, 6, 7, 8, 9})) + fmt.Println(RevConcatAlternate([]int{1, 2, 3, 9, 8}, []int{4, 5})) + fmt.Println(RevConcatAlternate([]int{1, 2, 3}, []int{})) } ``` diff --git a/subjects/reversesecondhalf/README.md b/subjects/reversesecondhalf/README.md index 3475f58e..c10fc613 100644 --- a/subjects/reversesecondhalf/README.md +++ b/subjects/reversesecondhalf/README.md @@ -25,13 +25,12 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Print(piscine.ReverseSecondHalf("This is the 1st half This is the 2nd half")) - fmt.Print(piscine.ReverseSecondHalf("")) - fmt.Print(piscine.ReverseSecondHalf("Hello World")) + fmt.Print(ReverseSecondHalf("This is the 1st half This is the 2nd half")) + fmt.Print(ReverseSecondHalf("")) + fmt.Print(ReverseSecondHalf("Hello World")) } ``` diff --git a/subjects/saveandmiss/README.md b/subjects/saveandmiss/README.md index 0505c6d9..483f31c2 100644 --- a/subjects/saveandmiss/README.md +++ b/subjects/saveandmiss/README.md @@ -13,6 +13,7 @@ func SaveAndMiss(arg string, num int) string { } ``` + ### Usage Here is a possible program to test your function: @@ -22,16 +23,15 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.SaveAndMiss("123456789", 3)) - fmt.Println(piscine.SaveAndMiss("abcdefghijklmnopqrstuvwyz", 3)) - fmt.Println(piscine.SaveAndMiss("", 3)) - fmt.Println(piscine.SaveAndMiss("hello you all ! ", 0)) - fmt.Println(piscine.SaveAndMiss("what is your name?", 0)) - fmt.Println(piscine.SaveAndMiss("go Exercise Save and Miss", -5)) + fmt.Println(SaveAndMiss("123456789", 3)) + fmt.Println(SaveAndMiss("abcdefghijklmnopqrstuvwyz", 3)) + fmt.Println(SaveAndMiss("", 3)) + fmt.Println(SaveAndMiss("hello you all ! ", 0)) + fmt.Println(SaveAndMiss("what is your name?", 0)) + fmt.Println(SaveAndMiss("go Exercise Save and Miss", -5)) } ``` diff --git a/subjects/setspace/README.md b/subjects/setspace/README.md index c8586bfb..2dd35530 100644 --- a/subjects/setspace/README.md +++ b/subjects/setspace/README.md @@ -29,15 +29,14 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.SetSpace("HelloWorld")) - fmt.Println(piscine.SetSpace("HelloWorld12")) - fmt.Println(piscine.SetSpace("Hello World")) - fmt.Println(piscine.SetSpace("")) - fmt.Println(piscine.SetSpace("LoremIpsumWord")) + fmt.Println(SetSpace("HelloWorld")) + fmt.Println(SetSpace("HelloWorld12")) + fmt.Println(SetSpace("Hello World")) + fmt.Println(SetSpace("")) + fmt.Println(SetSpace("LoremIpsumWord")) } ``` diff --git a/subjects/sliceadd/README.md b/subjects/sliceadd/README.md index 8b960e7f..83f56c34 100644 --- a/subjects/sliceadd/README.md +++ b/subjects/sliceadd/README.md @@ -23,13 +23,11 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Println(piscine.SliceAdd([]int{1, 2, 3}, 4)) - fmt.Println(piscine.SliceAdd([]int{}, 4)) + fmt.Println(SliceAdd([]int{1, 2, 3}, 4)) + fmt.Println(SliceAdd([]int{}, 4)) } ``` diff --git a/subjects/sliceremove/README.md b/subjects/sliceremove/README.md index cfd9b3b3..3946676c 100644 --- a/subjects/sliceremove/README.md +++ b/subjects/sliceremove/README.md @@ -23,14 +23,12 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Println(piscine.SliceRemove([]int{1, 2, 3}, 2)) - fmt.Println(piscine.SliceRemove([]int{4, 3}, 4)) - fmt.Println(piscine.SliceRemove([]int{}, 1)) + fmt.Println(SliceRemove([]int{1, 2, 3}, 2)) + fmt.Println(SliceRemove([]int{4, 3}, 4)) + fmt.Println(SliceRemove([]int{}, 1)) } ``` diff --git a/subjects/stringtobool/README.md b/subjects/stringtobool/README.md index 3c4dd095..57cc30f8 100644 --- a/subjects/stringtobool/README.md +++ b/subjects/stringtobool/README.md @@ -6,7 +6,6 @@ Write a function that takes a `string` as an argument and returns a `boolean`. - If the `string` equals `True`, `T` or `t` return `true`, otherwise return `false`. - ### Expected function ```go @@ -24,14 +23,13 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.StringToBool("True")) - fmt.Println(piscine.StringToBool("T")) - fmt.Println(piscine.StringToBool("False")) - fmt.Println(piscine.StringToBool("TTFF")) + fmt.Println(StringToBool("True")) + fmt.Println(StringToBool("T")) + fmt.Println(StringToBool("False")) + fmt.Println(StringToBool("TTFF")) } ``` diff --git a/subjects/swapfirst/README.md b/subjects/swapfirst/README.md index 3c7719d3..92ab4927 100644 --- a/subjects/swapfirst/README.md +++ b/subjects/swapfirst/README.md @@ -23,13 +23,12 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.SwapFirst([]int{1, 2, 3, 4})) - fmt.Println(piscine.SwapFirst([]int{3, 4, 6})) - fmt.Println(piscine.SwapFirst([]int{1})) + fmt.Println(SwapFirst([]int{1, 2, 3, 4})) + fmt.Println(SwapFirst([]int{3, 4, 6})) + fmt.Println(SwapFirst([]int{1})) } ``` diff --git a/subjects/swaplast/README.md b/subjects/swaplast/README.md index ac3a7aa3..6b887cd9 100644 --- a/subjects/swaplast/README.md +++ b/subjects/swaplast/README.md @@ -2,7 +2,7 @@ ### Instructions - Write a function that takes as an argument a slice of integers and return another slice of integers with the last two elements swapped. +Write a function that takes as an argument a slice of integers and return another slice of integers with the last two elements swapped. > If the slice contains less than two elements return the same slice. @@ -23,13 +23,12 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Println(piscine.SwapLast([]int{1, 2, 3, 4})) - fmt.Println(piscine.SwapLast([]int{3, 4, 5})) - fmt.Println(piscine.SwapLast([]int{1})) + fmt.Println(SwapLast([]int{1, 2, 3, 4})) + fmt.Println(SwapLast([]int{3, 4, 5})) + fmt.Println(SwapLast([]int{1})) } ``` diff --git a/subjects/thirdtimeisacharm/README.md b/subjects/thirdtimeisacharm/README.md index 44c6ac1c..0b3ef713 100644 --- a/subjects/thirdtimeisacharm/README.md +++ b/subjects/thirdtimeisacharm/README.md @@ -25,14 +25,13 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Print(piscine.ThirdTimeIsACharm("123456789")) - fmt.Print(piscine.ThirdTimeIsACharm("")) - fmt.Print(piscine.ThirdTimeIsACharm("a b c d e f")) - fmt.Print(piscine.ThirdTimeIsACharm("12")) + fmt.Print(ThirdTimeIsACharm("123456789")) + fmt.Print(ThirdTimeIsACharm("")) + fmt.Print(ThirdTimeIsACharm("a b c d e f")) + fmt.Print(ThirdTimeIsACharm("12")) } ``` diff --git a/subjects/weareunique/README.md b/subjects/weareunique/README.md index 2c23fe7a..64455412 100644 --- a/subjects/weareunique/README.md +++ b/subjects/weareunique/README.md @@ -24,14 +24,12 @@ package main import ( "fmt" - - "piscine" ) func main() { - fmt.Println(piscine.WeAreUnique("foo", "boo")) - fmt.Println(piscine.WeAreUnique("", "")) - fmt.Println(piscine.WeAreUnique("abc", "def")) + fmt.Println(WeAreUnique("foo", "boo")) + fmt.Println(WeAreUnique("", "")) + fmt.Println(WeAreUnique("abc", "def")) } ``` diff --git a/subjects/wordflip/README.md b/subjects/wordflip/README.md index 5186bca0..78d0c154 100644 --- a/subjects/wordflip/README.md +++ b/subjects/wordflip/README.md @@ -25,14 +25,13 @@ package main import ( "fmt" - "piscine" ) func main() { - fmt.Print(piscine.WordFlip("First second last")) - fmt.Print(piscine.WordFlip("")) - fmt.Print(piscine.WordFlip(" ")) - fmt.Print(piscine.WordFlip(" hello all of you! ")) + fmt.Print(WordFlip("First second last")) + fmt.Print(WordFlip("")) + fmt.Print(WordFlip(" ")) + fmt.Print(WordFlip(" hello all of you! ")) } ``` diff --git a/subjects/zipstring/README.md b/subjects/zipstring/README.md index 6d8d5661..8e730040 100644 --- a/subjects/zipstring/README.md +++ b/subjects/zipstring/README.md @@ -23,7 +23,6 @@ package main import ( "fmt" - "piscine" ) func main() {