Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelwp/go-shuffle
https://github.com/michaelwp/go-shuffle
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/michaelwp/go-shuffle
- Owner: michaelwp
- License: mit
- Created: 2021-04-30T09:16:40.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-01T14:47:04.000Z (almost 4 years ago)
- Last Synced: 2024-06-21T08:18:45.133Z (8 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-shuffle v1.2.2
Ini adalah package bahasa pemrograman go sederhana untuk mengacak susunan list array.
### func Shuffle()
```go
func (l List) Shuffle() List
```
```go
func (l ListTimes) Shuffle() List
```### Instalasi
`go get -u github.com/michaelwp/go-shuffle`
### Contoh penggunaan
```go
package mainimport (
"fmt"
goshuffle "github.com/michaelwp/go-shuffle"
)func main() {
var list = goshuffle.List{1,"a",3,"z",5}
var listTimes = goshuffle.ListTimes{
List: list,
Times: 5,
}fmt.Println(list.Shuffle())
fmt.Println(listTimes.Shuffle())
}
```#### Hasil
```text
[a 3 z 5 1]
[[5 1 3 z a] [3 5 a 1 z] [z 3 5 a 1] [a 1 3 5 z] [3 5 1 z a]]
```