Skip to content

Commit

Permalink
Update enigma_machine_emulator.cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
Normolo authored Jul 11, 2021
1 parent 0155ad3 commit 9376bde
Showing 1 changed file with 74 additions and 33 deletions.
107 changes: 74 additions & 33 deletions templates/enigma_machine_emulator.cxx
Original file line number Diff line number Diff line change
@@ -1,33 +1,74 @@
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]
output[input('D/E: ')]
if input(ln[1]) = 'E':
output[input('E: ')]
output[input('R: ')]

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

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

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[3]))]

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

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

const[X6] = function[merge(all.instances(X5))]

output[X6]
if input(ln[1]) = 'D':
output[input('E: ')]
output[input('R: ')]

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

const[X] = function[seperate(input(ln[40])
const[math.un_random] = math.esot.revert.probability.randomness.function

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.un_random(char=r.input..true)]
const[X2] = function[math.root(X1).num(input(ln[30]))]

const[X3] = function[math.un_random(char=r.input..true)]
const[X4] = function[math.root(X3).num(input(ln[30]))]

const[X4] = function[math.un_random(char=r.input..true)]
const[X5] = function[math.root(X4).num(input(ln[30]))]

const[X6] = function[merge(all.instances(X5))]

output[X6]

0 comments on commit 9376bde

Please sign in to comment.