diff --git a/subjects/displayalpham.md b/subjects/displayalpham.md new file mode 100644 index 00000000..45e4b70e --- /dev/null +++ b/subjects/displayalpham.md @@ -0,0 +1,16 @@ +# displayalpham +## Instructions + +Write a program that displays the alphabet, with even letters in uppercase, and +odd letters in lowercase, followed by a newline. + +The function must have the next signature. + +Example : + +```console +student@ubuntu:~/student/displayalpham$ go build +student@ubuntu:~/student/displayalpham$ ./displayalpham | cat -e +aBcDeFgHiJkLmNoPqRsTuVwXyZ$ +student@ubuntu:~/student/displayalpham$ +``` diff --git a/subjects/displayalrevm.md b/subjects/displayalrevm.md new file mode 100644 index 00000000..0cbe0f7b --- /dev/null +++ b/subjects/displayalrevm.md @@ -0,0 +1,16 @@ +# displayalrevm +## Instructions + +Write a program that displays the alphabet in reverse, with even letters in +uppercase, and odd letters in lowercase, followed by a newline. + +The function must have the next signature. + +Example : + +```console +student@ubuntu:~/student/displayalrevm$ go build +student@ubuntu:~/student/displayalrevm$ ./displayalrevm | cat -e +aBcDeFgHiJkLmNoPqRsTuVwXyZ$ +student@ubuntu:~/student/displayalrevm$ +``` diff --git a/subjects/lastword.md b/subjects/lastword.md new file mode 100644 index 00000000..4e3fabb0 --- /dev/null +++ b/subjects/lastword.md @@ -0,0 +1,28 @@ +# lastword +## Instructions + +Write a program that takes a string and displays its last word, followed by a +newline. + +A word is a section of string delimited by spaces/tabs or by the start/end of +the string. + +If the number of parameters is not 1, or if there are no words, simply display +a newline. + +Example : + +```console +student@ubuntu:~/student/lastword$ go build +student@ubuntu:~/student/lastword$ ./lastword "FOR PONY" | cat -e +PONY$ +student@ubuntu:~/student/lastword$ ./lastword "this ... is sparta, then again, maybe not" | cat -e +not$ +student@ubuntu:~/student/lastword$ ./lastword " " | cat -e +$ +student@ubuntu:~/student/lastword$ ./lastword "a" "b" | cat -e +$ +student@ubuntu:~/student/lastword$ ./lastword " lorem,ipsum " | cat -e +lorem,ipsum$ +student@ubuntu:~/student/lastword$ +``` diff --git a/subjects/onlyz.md b/subjects/onlyz.md new file mode 100644 index 00000000..5adccad0 --- /dev/null +++ b/subjects/onlyz.md @@ -0,0 +1,4 @@ +# displayalpham +## Instructions + +Write a program that displays a 'z' character on the standard output. \ No newline at end of file diff --git a/subjects/repeatalpha.md b/subjects/repeatalpha.md new file mode 100644 index 00000000..321f5134 --- /dev/null +++ b/subjects/repeatalpha.md @@ -0,0 +1,29 @@ +# repeatalpha +## Instructions + +Write a program called repeat_alpha that takes a string and display it +repeating each alphabetical character as many times as its alphabetical index, +followed by a newline. + +'a' becomes 'a', 'b' becomes 'bb', 'e' becomes 'eeeee', etc... + +Case remains unchanged. + +If the number of arguments is not 1, just display a newline. + +Examples: + +```console +student@ubuntu:~/student/repeatalpha$ go build +student@ubuntu:~/student/repeatalpha$ ./repeatalpha "abc" | cat -e +abbccc +student@ubuntu:~/student/repeatalpha$ ./repeatalpha "Alex." | cat -e +Alllllllllllleeeeexxxxxxxxxxxxxxxxxxxxxxxx.$ +student@ubuntu:~/student/repeatalpha$ ./repeatalpha "abacadaba 42!" | cat -e +abbacccaddddabba 42!$ +student@ubuntu:~/student/repeatalpha$ ./repeatalpha | cat -e +$ +student@ubuntu:~/student/repeatalpha$ ./repeatalpha "" | cat -e +$ +student@ubuntu:~/student/repeatalpha$ +``` diff --git a/subjects/reversebits.md b/subjects/reversebits.md new file mode 100644 index 00000000..c0b9e01c --- /dev/null +++ b/subjects/reversebits.md @@ -0,0 +1,20 @@ +# reversebits +## Instructions + +Write a function that takes a byte, reverses it, bit by bit (like the +example) and returns the result. + +Your function must be declared as follows: + +func ReverseBits(octet byte) byte { + ... +} + +Example: + + 1 byte +_____________ + 00100110 + || + \/ + 01100100 diff --git a/subjects/swapbits.md b/subjects/swapbits.md new file mode 100644 index 00000000..cffe7d56 --- /dev/null +++ b/subjects/swapbits.md @@ -0,0 +1,20 @@ +# swapbits +## Instructions + +Write a function that takes a byte, swaps its halves (like the example) and +returns the result. + +Your function must be declared as follows: + +func SwapBits(octet byte) byte { + ... +} + +Example: + + 1 byte +_____________ + 0100 | 0001 + \ / + / \ + 0001 | 0100 \ No newline at end of file diff --git a/subjects/union.md b/subjects/union.md new file mode 100644 index 00000000..ceeba1f8 --- /dev/null +++ b/subjects/union.md @@ -0,0 +1,27 @@ +# union +## Instructions + +Write a program that takes two strings and displays, without doubles, the +characters that appear in either one of the strings. + +The display will be in the order characters appear in the command line, and +will be followed by a \n. + +If the number of arguments is not 2, the program displays \n. + +Example : + +```console +student@ubuntu:~/student/union$ go build +student@ubuntu:~/student/union$ ./union zpadinton "paqefwtdjetyiytjneytjoeyjnejeyj" | cat -e +zpadintoqefwjy$ +student@ubuntu:~/student/union$ ./union ddf6vewg64f gtwthgdwthdwfteewhrtag6h4ffdhsd | cat -e +df6vewg4thras$ +student@ubuntu:~/student/union$ ./union "rien" "cette phrase ne cache rien" | cat -e +rienct phas$ +student@ubuntu:~/student/union$ ./union | cat -e +$ +student@ubuntu:~/student/union$ ./union "rien" | cat -e +$ +student@ubuntu:~/student/union$ +```