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.
24 lines
468 B
24 lines
468 B
5 years ago
|
package correct
|
||
5 years ago
|
|
||
5 years ago
|
// this function will put a in c; c in d; d in b and b in a
|
||
5 years ago
|
func Enigma(a ***int, b *int, c *******int, d ****int) {
|
||
|
valc := *******c
|
||
|
*******c = ***a
|
||
|
vald := ****d
|
||
|
****d = valc
|
||
|
valb := *b
|
||
|
*b = vald
|
||
|
***a = valb
|
||
|
}
|
||
|
|
||
5 years ago
|
// Helper function used in the test for checking the function Enigma()
|
||
5 years ago
|
func Decript(a ***int, b *int, c *******int, d ****int) {
|
||
|
vala := ***a
|
||
|
***a = *******c
|
||
|
valb := *b
|
||
|
*b = vala
|
||
|
vald := ****d
|
||
|
****d = valb
|
||
|
*******c = vald
|
||
|
}
|