Sha256: 1e101990b87c58b912529c82e15fd21cfc84371a071c98f06ccb2b3eb2685f28

Contents?: true

Size: 945 Bytes

Versions: 77

Compression:

Stored size: 945 Bytes

Contents

package railfence

// Source: exercism/problem-specifications
// Commit: 88db37b rail-fence-cipher: apply "input" policy
// Problem Specifications Version: 1.1.0

type testCase struct {
	description string
	message     string
	rails       int
	expected    string
}

// encode
var encodeTests = []testCase{

	{"encode with two rails",
		"XOXOXOXOXOXOXOXOXO",
		2,
		"XXXXXXXXXOOOOOOOOO"},

	{"encode with three rails",
		"WEAREDISCOVEREDFLEEATONCE",
		3,
		"WECRLTEERDSOEEFEAOCAIVDEN"},

	{"encode with ending in the middle",
		"EXERCISES",
		4,
		"ESXIEECSR"},
}

// decode
var decodeTests = []testCase{

	{"decode with three rails",
		"TEITELHDVLSNHDTISEIIEA",
		3,
		"THEDEVILISINTHEDETAILS"},

	{"decode with five rails",
		"EIEXMSMESAORIWSCE",
		5,
		"EXERCISMISAWESOME"},

	{"decode with six rails",
		"133714114238148966225439541018335470986172518171757571896261",
		6,
		"112358132134558914423337761098715972584418167651094617711286"},
}

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.179 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.178 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.177 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.176 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.175 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.174 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.173 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.172 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.171 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.170 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.169 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.167 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.166 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.165 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.164 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.163 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.162 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.161 tracks/go/exercises/rail-fence-cipher/cases_test.go
trackler-2.2.1.160 tracks/go/exercises/rail-fence-cipher/cases_test.go