forked from Ubn-Jr/siralamasyon_bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
64 lines (51 loc) · 1.55 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// SIRALAMASYON BOT
// NOTLAR:
// * Her fonksiyonun en az üç testi olmalı
package main
// Bir string değeri alıp bu değerin
// liste olup olmadığını kontrol eden fonksiyon
// Liste süslü parantezle başlamalı ve bitmeli
// Liste elemanları virgülle ayrılmalı
// Kapatan süslü parantezden önceki son karakter ve
// Açan süslü parantezden sonraki değer virgül olmamalı
func stringListeMi(discordMesaji string) bool {
// TODO: Bu fonksiyonun içi doldurulacak : Beyzanur
if discordMesaji[0] != '{' || discordMesaji[len(discordMesaji)-1] != '}' {
return false
} else {
return true
}
}
// Gelen string degerini listeye cevir
func stringiListeyeCevir(discordMesaji string) []int {
chars := []byte(discordMesaji)
for i := 0; i < len(chars); i++ {
char := string(chars[i])
fmt.Println(char)
}
if chars == "" {
fmt.Println("Hata: Boş bir mesaj verildi!")
return false
} else {
return true
}
}
func dizidekiDegerlerSayiMi(dizi string) bool {
for key, val := range arr {
_, err := strconv.Atoi(val)
if err != nil {
return false
}
}
return true
}
// Kullanıcıya hata mesajı göster
func hataMesajiGoster(hataMesaji string) {
}
func main() {
// stringListeMi fonksiyonunu test et
// var listeMi1 = stringListeMi("12341413123123") // false
// stringiListeyeCevir fonksiyonunu test et
// dizidekiDegerlerSayiMi fonksiyonunu test et
// hataMesajiGoster fonksiyonunu test et
}