summaryrefslogtreecommitdiff
path: root/example_test.go
blob: 2ccf83bb331f9d92e65a9f17e5fdc0766044b598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package caesar

import (
	"fmt"
)

func ExampleEncode() {
	secret := Encode("attack at dawn")
	fmt.Println(secret)
	// Output: dwwdfn dw gdzq
}

func ExampleCoder() {
	c := Coder{
		Key: 5,
		Ranges: []RuneRange{
			{Start: 'A', End: 'Z'},
		},
	}
	fmt.Println(c.Encode("aAbBcCdD"))
	// Output: aFbGcHdI
}