Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alphamirror: fix newline #91

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f8f51c7
fix format paramrange_test
Hamzaelkhatri Jul 7, 2022
0e1fa90
fixing the solution of rotatevowels
MSilva95 Jul 12, 2022
827834a
Fix format
Hamzaelkhatri Jul 13, 2022
a295790
add(test):arg-rot1
Hamzaelkhatri Jun 13, 2022
a32e87b
Update main.go
Hamzaelkhatri Jul 6, 2022
e51ae79
fix format
Hamzaelkhatri Jul 6, 2022
786fbb2
feat: Add solution for oddlength
eslopfer Jun 23, 2022
d1a7bb0
test: Add test for oddlength
eslopfer Jun 23, 2022
fdb00ec
correct format
zainabdnaya Jul 7, 2022
1a60bab
feat: add solution for prinevenarguments subject
eslopfer Jun 29, 2022
e23ac5d
test: add test for printevenarguments subject
eslopfer Jun 29, 2022
bc55941
Correct wrong program name
eslopfer Jun 29, 2022
766b00e
fix: Fix solution as per review
eslopfer Jul 11, 2022
3c394c3
test: Add test case suggested in review
eslopfer Jul 11, 2022
08e4316
add(Test): add solution and test for rev args
Hamzaelkhatri Jun 13, 2022
26b1ed8
Update main.go
Hamzaelkhatri Jun 22, 2022
c46e63f
Update main.go
Hamzaelkhatri Jun 22, 2022
c5ec42f
Update main.go
Hamzaelkhatri Jun 28, 2022
a181bc5
add empty
MSilva95 Jul 8, 2022
24bc641
add(test): printmiddle
Hamzaelkhatri Jun 13, 2022
004f0f8
Update main.go
Hamzaelkhatri Jun 23, 2022
815a83c
Update main.go
Hamzaelkhatri Jun 24, 2022
39f6b81
fix format
Hamzaelkhatri Jul 7, 2022
4ceeb0b
add empty case
MSilva95 Jul 8, 2022
8484524
feat: Add solution for popint subject
eslopfer Jun 24, 2022
1c0e9ba
test: Add test for popint subject
eslopfer Jun 24, 2022
0b5cfdf
add(test):add test & solution
Hamzaelkhatri Jun 8, 2022
631befe
fix(test):fix func name & test
Hamzaelkhatri Jun 9, 2022
cef29cc
fix(prototype):fix name
Hamzaelkhatri Jun 9, 2022
389cc1b
Update main.go
Hamzaelkhatri Jun 17, 2022
240e52e
fix:format & remove unsed library
Hamzaelkhatri Jun 24, 2022
f73cb9b
Update main.go
Hamzaelkhatri Jun 28, 2022
c05deee
test(swap-args):add test & solution
Hamzaelkhatri Jun 16, 2022
3e9cfde
fix:name of program
Hamzaelkhatri Jun 24, 2022
054b6fe
fix: space between args
Hamzaelkhatri Jun 27, 2022
668304c
Add solution for concatenate subject
eslopfer Jun 29, 2022
05ee99f
test: Add tests for concatenate subject
eslopfer Jun 29, 2022
6e8c5b1
Add missing test
eslopfer Jun 29, 2022
2892f22
test: Add test cases as per review
eslopfer Jul 1, 2022
98df52d
feat: Add solution for sum subject
eslopfer Jun 29, 2022
30896bc
test: Add test for sum subject
eslopfer Jun 29, 2022
b4a1255
test: add missing test cases
eslopfer Jun 29, 2022
465d701
feat: Implement solution for evenlength subject
eslopfer Jun 30, 2022
a22ea61
test: Implement test for evenlength subject
eslopfer Jun 30, 2022
b52f9a0
feat: Add solution for delete subject
eslopfer Jun 30, 2022
44c263e
test: Write test for delete subject
eslopfer Jun 30, 2022
8ce3d00
feat: Add solution to pingpong subject
eslopfer Jun 22, 2022
d713202
test: Add test for pingpong subject
eslopfer Jun 22, 2022
67e08e3
test: add one more test case
eslopfer Jun 22, 2022
c894836
fix: Add extra line at the end of file as by the review
eslopfer Jun 24, 2022
9ce4d8e
test: Add random tests as per review
eslopfer Jun 28, 2022
d851014
fix: Remove random tests
eslopfer Jun 28, 2022
57db84b
squareroot
zainabdnaya Jun 20, 2022
699a0f8
squareroot
zainabdnaya Jun 20, 2022
283c241
corrected
zainabdnaya Jul 7, 2022
83ec195
Merge pull request #81 from 01-edu/80-fix-format-for-new-exam-exercices
Hamzaelkhatri Jul 16, 2022
6c8cec9
Merge pull request #79 from 01-edu/rotatevowels-solution-fix
MSilva95 Jul 20, 2022
81f2b7e
alphamirror: fix newline
rcatini Jul 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixing the solution of rotatevowels
  • Loading branch information
MSilva95 committed Jul 12, 2022
commit 0e1fa9038b243a28e902fe086354fa7d2f247b29
48 changes: 28 additions & 20 deletions solutions/rotatevowels/main.go
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
package main

import (
"fmt"
"os"
"strings"

"github.com/01-edu/z01"
)

func main() {
var a1, a2, rev []rune
for _, arg := range os.Args[1:] {
for _, k := range arg {
if strings.ContainsRune("aeiouAEIOU", k) {
a1 = append(a1, k)
var vowels []rune

arguments := os.Args[1:]

for _, i := range arguments {
for j := 0; j < len(i); j++ {
if IsVowel(i[j]) {
vowels = append(vowels, rune(i[j]))
}
}
}
for i := len(a1) - 1; i >= 0; i-- {
rev = append(rev, a1[i])
}

m := 0
for i, arg := range os.Args[1:] {
for _, j := range arg {
if strings.ContainsRune("aeiouAEIOU", j) {
a2 = append(a2, rev[m])
m++
counter := len(vowels) - 1

for s, i := range arguments {
for j := 0; j < len(i); j++ {
if IsVowel(i[j]) {
z01.PrintRune(rune(vowels[counter]))
counter--
} else {
a2 = append(a2, j)
z01.PrintRune(rune(i[j]))
}
}
if i != len(os.Args)-1 {
a2 = append(a2, ' ')
if s != len(arguments)-1 {
z01.PrintRune(' ')
}
}
fmt.Println(string(a2))
z01.PrintRune('\n')
}

func IsVowel(s byte) bool {
if s == 65 || s == 69 || s == 73 || s == 79 || s == 85 || s == 97 || s == 101 || s == 105 || s == 111 || s == 117 {
return true
}
return false
}