#Encryption algorithm help

1 messages · Page 1 of 1 (latest)

gloomy daggerBOT
#

<@&987246399047479336> please have a look, thanks.

gloomy daggerBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

dusty violet
#

Here's what a part of the encryption algorithm is asking for: If a word has n letters, where n is an even number, first move the first n/2 letters to the end of the word. For example, 'before' becomes 'orebef'.

#

Here is my current output, the element lengths included were not present within the posted code but just used as reference

Life
is
either
a
daring
adventure
or
nothing
at
all

First Element Length: 4
Second Element Length: 2
Third Element Length: 6
Fourth Element Length: 1
Fifth Element Length: 6
Sixth Element Length: 9
Seventh Element Length: 2
Eighth Element Length: 7
Nineth Element Length: 2
Tenth Element Length: 3

No. items in array list: 10
vast cedar
#

Can you share your code for the algorithm ?

#

What about the words where n is odd? Do we need to change them in a different way ?

dusty violet
#

I don't have code for the algorithm since I had trouble getting it started running into the issue with the if statement. Here's the second part of the algorithm, "If a word has n letters, where n is an odd number, move the first (n+1)/2 to the end of the word. For example: 'kitchen' becomes 'henkitc'.

dusty violet
#

!close

gloomy daggerBOT
# dusty violet !close

Looks like you attempted to use a command? Please note that we only use slash-commands on this server 🙂

Try starting your message with a forward-slash / and Discord should open a popup showing you all available commands.
A command might then look like /foo 👍