Created
June 17, 2016 17:30
-
-
Save asm-jaime/57a6e198c4153d57d358876f40b6e8d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
const num_count int = 146 | |
const fill_char string = "5" | |
const first_check string = "333" | |
const first_change string = "5" | |
const second_check string = "555" | |
const second_change string = "3" | |
func main() { | |
this_string := strings.Repeat(fill_char, num_count) | |
for strings.Index(this_string, first_check) > -1 || strings.Index(this_string, second_check) > -1 { | |
if strings.Index(this_string, first_check) > -1 { | |
this_string = strings.Replace(this_string, first_check, first_change, 1) | |
} else { | |
this_string = strings.Replace(this_string, second_check, second_change, 1) | |
} | |
} | |
fmt.Print(this_string) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment