Releases: VSN-Robotics-Club/luna
Release list
tinydolphine v1.0.1
Full Changelog: https://github.com/VSN-Robotics-Club/luna/commits/tinydolphine
import time
import random
import os
Chatbot welcome and menu
i = input("Press any key to continue: ")
time.sleep(1)
print("Luna is loading ..")
time.sleep(1)
print("Luna is loading ....")
time.sleep(1)
print("Luna is loading .......")
time.sleep(3)
print('''
⠀⠀⠀⠀⣠⠤⠖⠚⢉⣩⣭⡭⠛⠓⠲⠦⣄⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢀⡴⠋⠁⠀⠀⠊⠀⠀⠀⠤⠀⠀⠐⠢⢤⠉⠳⢦⡀⠀⠀⠀⠀
⠀⠀⠀⠀⢀⡴⠃⢀⡴⢳⠰⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣆⠀⠀⠀
⠀⠀⠀⠀⡾⠁⣠⠋⠀⠈⢧⠀⠉⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢧⠀⠀
⠀⠀⠀⣸⠁⢰⠃⠀⠀⠀⠈⢣⡀⠀⠉⠒⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣇⠀
⠀⠀⠀⡇⠀⡾⡀⠀⠀⠀⠀⣀⣹⣆⡀⠀⠀⠀⠉⠑⠒⢤⡀⠀⠀⠀⠀⠀⢹⠀
⠀⠀⢸⠃⢀⣇⡈⠀⠀⠀⠀⠀⠀⢀⡑⢄⡀⢀⡀⠀⠀⠘⡆⠀⠀⠀⠀⠀⢸⡇
⠀⠀⢸⠀⢻⡟⡻⢶⡆⠀⠀⠀⠀⡼⠟⡳⢿⣦⡑⢄⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇
⠀⠀⣸⠀⢸⠃⡇⢀⠇⠀⠀⠀⠀⠀⡼⠀⠀⠈⣿⡗⠂⠀⠀⠀⠀⠀⠀⠀⢸⠁
⠀⠀⡏⠀⣼⠀⢳⠊⠀⠀⠀⠀⠀⠀⠱⣀⣀⠔⣸⠁⠀⠀⡤⠀⠀⠀⠀⢠⡟⠀
⠀⠀⡇⢀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠘⠀⠀⠀⠀⢸⠃⠀
⠀⢸⠃⠘⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠁⠀⠀⢀⠀⠀⠀⠀⠀⣾⠀⠀
⠀⣸⠀⠀⠹⡄⠀⠀⠈⠑⠀⠀⠀⠀⠀⠀⠀⡞⠀⠀⠀⠸⠀⠀⠀⠀⠀⡇⠀⠀
⠀⡏⠀⠀⠀⠙⣆⠀⠀⠀⠀⠀⠀⠀⢀⣠⢶⡇⠀⠀⢰⡀⠀⠀⠀⠀⠀⡇⠀⠀
⢰⠇⡄⠀⠀⠀⡿⢣⣀⣀⣀⡤⠴⡞⠉⠀⢸⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⣧⠀⠀
⣸⠀⡇⠀⠀⠀⠀⠀⠀⠉⠀⠀⠀⢹⠀⠀⢸⠀⠀⢀⣿⠇⠀⠀⠀⠁⠀⢸⠀⠀
⣿⠀⡇⠀⠀⠀⠀⠀⢀⡤⠤⠶⠶⠾⠤⠄⢸⠀⡀⠸⣿⣀⠀⠀⠀⠀⠀⠈⣇⠀
⡇⠀⡇⠀⠀⡀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠸⡌⣵⡀⢳⡇⠀⠀⠀⠀⠀⠀⢹⡀
⡇⠀⠇⠀⠀⡇⡸⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠮⢧⣀⣻⢂⠀⠀⠀⠀⠀⠀⢧
⣇⠀⢠⠀⠀⢳⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡎⣆⠀⠀⠀⠀⠀⠘
⢻⠀⠈⠰⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⠘⢮⣧⡀⠀⠀⠀⢠
⠸⡆⠀⠀⠇⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠆⠀⠀⠀⠀⠀⠀⠀⠙⠳⣄⡀⢢⡈
''')
print("Welcome to Luna AI! How may I help you today?")
print("1. Chat with me")
print("2. Play a game")
print("3. Learn something new")
print("4. Exit")
choice = input("Enter your choice: ")
prompt = input("AI: ")
Chat feature
if choice == "1":
print("Let's chat!")
while True:
user_input = input("You: ")
if user_input.lower() == "quit":
print("Exiting chat.")
break
responses = [
"I'm here to help you!",
"That's interesting. Tell me more.",
"Could you elaborate on that?",
"I see. What else can I do for you?"
]
print("Luna:", random.choice(responses))
Game feature
elif choice == "2":
print("Let's play a game!")
print("1. Hangman")
print("2. Tic Tac Toe")
print("3. Rock Paper Scissors")
print("4. Exit")
game_choice = input("Enter your choice: ")
# Hangman game
if game_choice == "1":
word = "hangman"
word_completion = "_" * len(word)
guessed = False
guessed_letters = []
guessed_words = []
tries = 6
print("Let's play Hangman!")
print("\n" + word_completion)
while not guessed and tries > 0:
guess = input("Please guess a letter or word: ").lower()
if len(guess) == 1 and guess.isalpha():
if guess in guessed_letters:
print("You already guessed the letter", guess)
elif guess not in word:
print("Letter", guess, "is not in the word.")
tries -= 1
guessed_letters.append(guess)
else:
print("Good job!", guess, "is in the word!")
guessed_letters.append(guess)
word_as_list = list(word_completion)
indices = [i for i, letter in enumerate(word) if letter == guess]
for index in indices:
word_as_list[index] = guess
word_completion = "".join(word_as_list)
if "_" not in word_completion:
guessed = True
elif len(guess) == len(word) and guess.isalpha():
if guess in guessed_words:
print("You already guessed the word", guess)
elif guess != word:
print(guess, "is not the word.")
tries -= 1
guessed_words.append(guess)
else:
guessed = True
word_completion = word
else:
print("Invalid guess.")
print(word_completion)
print("Tries left:", tries)
if guessed:
print("Congratulations! You guessed the word!")
else:
print("Sorry, you ran out of tries. The word was", word)
# Tic Tac Toe game
elif game_choice == "2":
board = [' ' for _ in range(9)]
def print_board():
print(' ' + board[0] + ' | ' + board[1] + ' | ' + board[2])
print('-----------')
print(' ' + board[3] + ' | ' + board[4] + ' | ' + board[5])
print('-----------')
print(' ' + board[6] + ' | ' + board[7] + ' | ' + board[8])
print("Let's play Tic Tac Toe!")
print_board()
current_player = "X"
game_over = False
while not game_over:
move = int(input(f"Player {current_player}, enter your move (1-9): ")) - 1
if board[move] == ' ':
board[move] = current_player
print_board()
# Check for win
win_conditions = [(0, 1, 2), (3, 4, 5), (6, 7, 8),
(0, 3, 6), (1, 4, 7), (2, 5, 8),
(0, 4, 8), (2, 4, 6)]
for condition in win_conditions:
if board[condition[0]] == board[condition[1]] == board[condition[2]] != ' ':
print(f"Player {current_player} wins!")
game_over = True
break
if ' ' not in board:
print("It's a tie!")
game_over = True
# Switch players
current_player = "O" if current_player == "X" else "X"
else:
print("That spot is taken. Try another.")
# Rock Paper Scissors game
elif game_choice == "3":
print("Let's play Rock Paper Scissors!")
while True:
user_choice = input("Enter Rock, Paper, or Scissors (or 'quit' to exit): ").lower()
if user_choice == "quit":
break
choices = ["rock", "paper", "scissors"]
computer_choice = random.choice(choices)
print("Computer chose:", computer_choice)
if user_choice == computer_choice:
print("It's a tie!")
elif (user_choice == "rock" and computer_choice == "scissors") or \
(user_choice == "scissors" and computer_choice == "paper") or \
(user_choice == "paper" and computer_choice == "rock"):
print("You win!")
else:
print("You lose!")
Learn something new feature
elif choice == "3":
topics = ["Did you know that honey never spoils?",
"Sharks are older than trees.",
"Bananas are berries, but strawberries aren't.",
"The Eiffel Tower can be 15 cm taller during the summer."]
print("Here's something interesting:")
print(random.choice(topics))
Exit option
elif choice == "4":
print("Goodbye!")
else:
print("Invalid choice. Please restart the program and choose a valid option.")
if prompt == "hello":
print("Hello! Welcome luna ai.")
elif prompt == "how are you":
print("I'm doing well, thanks for asking!")
ans = os.system("ollama run tinydolphin")
time.sleep(8)
print(ans)