mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
468 B
23 lines
468 B
package correct |
|
|
|
// this function will put a in c; c in d; d in b and b in a |
|
func Enigma(a ***int, b *int, c *******int, d ****int) { |
|
valc := *******c |
|
*******c = ***a |
|
vald := ****d |
|
****d = valc |
|
valb := *b |
|
*b = vald |
|
***a = valb |
|
} |
|
|
|
// Helper function used in the test for checking the function Enigma() |
|
func Decript(a ***int, b *int, c *******int, d ****int) { |
|
vala := ***a |
|
***a = *******c |
|
valb := *b |
|
*b = vala |
|
vald := ****d |
|
****d = valb |
|
*******c = vald |
|
}
|
|
|