From 91fdaaa4bb4dccde8ffc035fa6df9b49a74dc087 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:57:27 +0000 Subject: [PATCH] Update sliceprog.en.md --- subjects/sliceprog.en.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subjects/sliceprog.en.md b/subjects/sliceprog.en.md index 54f75289f..8051399bc 100644 --- a/subjects/sliceprog.en.md +++ b/subjects/sliceprog.en.md @@ -13,9 +13,9 @@ This means that: ### Instructions -Write a **program** that replicates the javascript function `slice`. +Write a **function** that replicates the javascript function `slice`. -The program receives an array of strings and one or more integers, and returns an array of strings. The returned array is part of the received one but cut from the position indicated in the first int, until the position indicated by the second int. +The function receives an array of strings and one or more integers, and returns an array of strings. The returned array is part of the received one but cut from the position indicated in the first int, until the position indicated by the second int. In case there only exists one int, the resulting array begins in the position indicated by the int and ends at the end of the received array. @@ -41,11 +41,11 @@ import "fmt" func main(){ arr := []string{"coding", "algorithm", "ascii", "package", "golang"} - fmt.Println(arr, 1) - fmt.Println(arr, 2, 4) - fmt.Println(arr, -3) - fmt.Println(arr, -2, -1) - fmt.Println(arr, 2, 0) + fmt.Println(Slice(arr, 1)) + fmt.Println(Slice(arr, 2, 4)) + fmt.Println(Slice(arr, -3)) + fmt.Println(Slice(arr, -2, -1)) + fmt.Println(Slice(arr, 2, 0)) } ```