Skip to content

Commit

Permalink
Create enigma_machine_emulator.cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
Normolo authored Jul 8, 2021
1 parent eba56b4 commit 0155ad3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions templates/enigma_machine_emulator.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
output[input('E: ')]
output[input('R: ')]

const[r.input] = input(ln[2])
const[r.rot.1] = 'MNBVCZASDFGHJKLPOIUYTREWQ'
const[r.rot.2] = 'QWERTYUIOPKJHGFDSAZXCVBNN'
const[r.rot.3] = 'OKMIJNUHBYGVTGVCFXZADEWQA'

const[X] = function[seperate(input(ln[1])

if r.input = 1
r.rot.1 = true
r.rot.2 = false
r.rot.3 = false
if r.input = 2
r.rot.1 = false
r.rot.2 = true
r.rot.3 = false
if r.input = 3
r.rot.1 = false
r.rot.2 = false
r.rot.3 = true

const[X1] = function[math.randomize(char=r.input..true)]
const[X2] = function[math.power(X1).num(input(ln[1]))]

const[X3] = function[math.randomize(char=r.input..true)]
const[X4] = function[math.power(X3).num(input(ln[1]))]

const[X4] = function[math.randomize(char=r.input..true)]
const[X5] = function[math.power(X4).num(input(ln[1]))]

output[X5]

0 comments on commit 0155ad3

Please sign in to comment.