From a990db0eaa468fd313467a7ef65eff2e3762af13 Mon Sep 17 00:00:00 2001 From: g5-chappell <gareth2.chappell@live.uwe.ac.uk> Date: Mon, 18 Jul 2022 02:51:40 +0000 Subject: [PATCH] Update main.cpp --- main.cpp | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 848fde1..fcb02e6 100644 --- a/main.cpp +++ b/main.cpp @@ -61,11 +61,24 @@ std::string name_to_initials(std::string name) // The encode function recieves a the message from the web interface to be encoded and should return the encoded output. //----------------------------------------------------------------- -void set_shift(unsigned int value) { +void set_shift(unsigned int value) +{ + int number_shift; + + number_shift = value; + std::cout << value << '\n'; } -std::string encode(std::string message) { +std::string encode(std::string message) +{ + int i; + + for (int i = 0; i < message.length(); i++) + { + message[i] = message[i] + number_shift; + } + return message; } @@ -80,11 +93,21 @@ std::string encode(std::string message) { // The substitution_encode function recieves a the string message from the web interface to be encoded and should return the substituted/cyphered output. //----------------------------------------------------------------- -void substitution_set(std::string sub) { +void substitution_set(std::string sub) +{ + +// alphabet +char alphabet[26] = "abcdefghijklmnopqrstuvwxyz"; + std::cout << sub << '\n'; } -std::string substitution_encode(std::string message) { +std::string substitution_encode(std::string message) +{ + for (i = 0; i < message.length(); i++) + { + + } return message; } -- GitLab