Skip to content

Commit

Permalink
Merge pull request #37 from tomoish/profession-fix
Browse files Browse the repository at this point in the history
Fix judgeProfession
  • Loading branch information
tomoish authored Feb 2, 2024
2 parents 08ee007 + 8eecb0b commit a2d0dd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
30 changes: 13 additions & 17 deletions src/funcs/handle_profession.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package funcs

import (
"fmt"
)

// 職業を判定する関数
func judgeProfession(rank string, topLanguages []string, percentages []float64) string {
func JudgeProfession(rank string, topLanguages []string, percentages []float64) string {
// 職業のルートと言語を定義
magicRoute := map[string]string{
"TypeScript": "攻撃魔法", "R": "ネクロマンサー", "Flutter": "防御魔法",
Expand Down Expand Up @@ -119,15 +115,15 @@ func getFinalProfession(profession string, rank string) string {
return finalProfession
}

func main() {
fmt.Println(judgeProfession("C+", []string{"Go"}, []float64{100})) // 召喚士
fmt.Println(judgeProfession("A", []string{"Python", "Java"}, []float64{20, 20})) // 特級 士官と騎士
fmt.Println(judgeProfession("C", []string{}, []float64{})) // 少年
fmt.Println(judgeProfession("B-", []string{"TypeScript"}, []float64{100})) // 攻撃魔法の見習い
fmt.Println(judgeProfession("B", []string{"C"}, []float64{100})) // 初級 無法者
fmt.Println(judgeProfession("B+", []string{"Java"}, []float64{100})) // 中級 騎士
fmt.Println(judgeProfession("A-", []string{"Rust"}, []float64{100})) // 上級 回復術師
fmt.Println(judgeProfession("A", []string{"Go"}, []float64{100})) // 特級 召喚士
fmt.Println(judgeProfession("A+", []string{"Assembly"}, []float64{100})) // 賞金稼ぎのラスボス
fmt.Println(judgeProfession("S", []string{"Python"}, []float64{100})) // 神
}
// func main() {
// fmt.Println(judgeProfession("C+", []string{"Go"}, []float64{100})) // 召喚士
// fmt.Println(judgeProfession("A", []string{"Python", "Java"}, []float64{20, 20})) // 特級 士官と騎士
// fmt.Println(judgeProfession("C", []string{}, []float64{})) // 少年
// fmt.Println(judgeProfession("B-", []string{"TypeScript"}, []float64{100})) // 攻撃魔法の見習い
// fmt.Println(judgeProfession("B", []string{"C"}, []float64{100})) // 初級 無法者
// fmt.Println(judgeProfession("B+", []string{"Java"}, []float64{100})) // 中級 騎士
// fmt.Println(judgeProfession("A-", []string{"Rust"}, []float64{100})) // 上級 回復術師
// fmt.Println(judgeProfession("A", []string{"Go"}, []float64{100})) // 特級 召喚士
// fmt.Println(judgeProfession("A+", []string{"Assembly"}, []float64{100})) // 賞金稼ぎのラスボス
// fmt.Println(judgeProfession("S", []string{"Python"}, []float64{100})) // 神
// }
2 changes: 1 addition & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,5 @@ func main() {
// fmt.Println("totalIssueContributions: ", totalIssueContributions)
// fmt.Println("totalPullRequestContributions: ", totalPullRequestContributions)
// fmt.Println("totalRepositoryContributions: ", totalRepositoryContributions)

fmt.Println(funcs.JudgeProfession("C+", []string{"Go"}, []float64{100}))
}

0 comments on commit a2d0dd5

Please sign in to comment.