s2ward / 469

The bonelord language in Tibia
21 stars 8 forks source link

A few "solved" phrases using ChatGPT and a custom algorithm #18

Open GabrielBigardi opened 1 year ago

GabrielBigardi commented 1 year ago

So, i was chatting with ChatGPT about 469 language, and i ended up in a algorithm that gets the inverse matrix for the Hellgate Matrix, and uses that to decode segments of the phrase, and i've come to interesting results while trying to decode common 469 phrases, here's what i've "decoded" so far (it can be wrong, its just that it makes sense based on the output):

============ Avar Tar 469 poem: 29639 46781! 9063376290 3222011 677 80322429 67538 14805394, 6880326 677 63378129 337011 72683 149630 4378! 453 639 578300 986372 2953639! CONGRATULATIONS! YOU HAVE SUCCESSFULLY DECODED THIS MESSAGE, PLEASE PROCEED TO THE NEXT CHALLENGE!

I had also said to ChatGPT to solve that in a way that 46781 becomes "BEHOLDER", due to a previous algorithm i was trying giving this result, and another version of the poem: PARTY BEHOLDER! THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG, HELLO WORLD! CATS ARE AWESOME!

Both of these makes a kind of sense, given that "hello world" is a common programming phrase, and that could be a programmer's joke, and this programmer would love cats, also "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" is a phrase that envolves all the alphabet letters and it's used as testing too.

============ Tibia's 15 year event 469 phrase spoke by a NPC 3478 67 90871 97664 3466 0 345! EYE OF THE BEHOLDER!

I will also include a script that ChatGPT wrote for this, however even tho the logic may be right, it's giving errors, and even tho i'm a programmer i'm not a Python expert i will leave it, to see if it helps someone:

import numpy as np

# Define the inverse encoding matrix
inverse_encoding_matrix = np.array([[-1, 1, 1, 0],
                                    [1, -2, -1, 2],
                                    [0, 1, 0, -1],
                                    [-1, 2, 0, 1]])

# Define a function to decode a single word
def decode_word(encoded_word):
    # Split the encoded word into a list of integers
    encoded_list = [int(x) for x in encoded_word]

    # Create a 1D NumPy array from the encoded list
    encoded_vector = np.array(encoded_list)

    # Make sure the encoded vector has the same number of elements as the number of columns in the inverse encoding matrix
    encoded_vector.resize((4,), refcheck=False)

    # Decode the vector by matrix multiplication with the inverse encoding matrix
    decoded_vector = np.dot(encoded_vector, inverse_encoding_matrix)

    # Convert the decoded vector to a list of integers
    decoded_list = decoded_vector.astype(int).tolist()

    # Convert the list of integers to a string of uppercase letters
    decoded_word = "".join([chr(x + 65) for x in decoded_list])

    return decoded_word

# Test the function with the given encoded phrase
encoded_phrase = "3478 67 90871 97664 3466 0 345!"
words = [decode_word(word) for word in encoded_phrase.split()]
decoded_phrase = " ".join(words)
print(decoded_phrase)

PS: idk why this text is becoming bold/changing size, i hadn't told it to do so, sorry for that

fernandogarcia-dev commented 1 year ago

Hey, can you please include the ChatGPT conversations? Just to avoid spreading fake content, you know... Because if you're right, dude, this is really awesome!

fernandogarcia-dev commented 1 year ago

Also, I fixed the code:

import numpy as np

# Define the inverse encoding matrix
inverse_encoding_matrix = np.array([[-1, 1, 1, 0],
                                    [1, -2, -1, 2],
                                    [0, 1, 0, -1],
                                    [-1, 2, 0, 1]])

# Define a function to decode a single word
def decode_word(encoded_word):
    # Split the encoded word into a list of strings
    encoded_list_str = encoded_word.split()

    # Initialize an empty list to store valid integers
    encoded_list = []

    # Convert the list of strings to a list of integers, skipping non-integer elements
    for x in encoded_list_str:
        try:
            encoded_list.append(int(x))
        except ValueError:
            continue

    # Create a 1D NumPy array from the encoded list
    encoded_vector = np.array(encoded_list)

    # Make sure the encoded vector has the same number of elements as the number of columns in the inverse encoding matrix
    encoded_vector.resize((4,), refcheck=False)

    # Decode the vector by matrix multiplication with the inverse encoding matrix
    decoded_vector = np.dot(encoded_vector, inverse_encoding_matrix)

    # Convert the decoded vector to a list of integers
    decoded_list = decoded_vector.astype(int).tolist()

    # Wrap the decoded integers within the valid ASCII range (0 to 127) using modulo operation
    decoded_list = [x % 128 for x in decoded_list]

    # Convert the list of integers to a string of uppercase letters
    decoded_word = "".join([chr(x + 65) for x in decoded_list])

    return decoded_word

# Test the function with the given encoded phrase
encoded_phrase = "3478 67 90871 97664 3466 0 345!"
words = [decode_word(word) for word in encoded_phrase.split()]
decoded_phrase = " ".join(words)
print(decoded_phrase)

But the output is:

«WWA ~„„A J¸¸A AAAA ·KKA AAAA AAAA
GabrielBigardi commented 1 year ago

Hi, i've cleared my conversations with ChatGPT as i use it on my main job, but i've tried again and got some different results with a different algorithm, i'll post the photos: b1 b2 b3 b4

VitorLuizC commented 1 year ago

Chat GPT will never find the "469" solution. Chat GPT is a conversation model that synthesizes answers using the content found by searching for content related to your question.

So it found some algorithm, synthesized it using content related to explaining or teaching algorithms, and gave you some deciphered text based on "469", "bonelord," and "beholder" content it found. It didn't use the algorithm to decipher the text.

It just gave you what you wanted, an algorithm and some deciphered text.