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
![]()
4 years ago
|
package solutions
|
||
|
|
||
|
//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
|
||
|
}
|