Dex Logo

What to expect from Dex

How does Dex handle 10 Python syntax errors at a time?

Code

def function_one: 
  print("Hello Jesse"

function_one()

for i in range((1,5)):
  print("Hello there, Walt"

y = 3

if x == 3:
  print("x equals 3 ounces)
                              
name == "Mr. White"

if name = "Mr. White":
  print("Ozymandias")

grams = [3, 4, 5]

for amount in grams
  print(f"I need {amount grams")
                  
Trial 1 - 3.343 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 1
Description: Fixed the function definition syntax by adding parentheses after 'function_one'.
            
### FIX 1 ###
Line number: 2
Description: Closed the print statement for 'Hello Jesse' with a closing parenthesis.
            
### FIX 2 ###
Line number: 5
Description: Corrected the range function by removing extra parentheses.
            
### FIX 3 ###
Line number: 7
Description: Closed the print statement for 'Hello there, Walt' with a closing parenthesis.
            
### FIX 4 ###
Line number: 9
Description: Corrected the if statement by defining 'x' before comparing it.
            
### FIX 5 ###
Line number: 12
Description: Closed the string in the if statement that checks if 'x' equals 3.
            
### FIX 6 ###
Line number: 14
Description: Changed '==' to '=' to correctly assign 'Mr. White' to 'name'.
            
### FIX 7 ###
Line number: 16
Description: Corrected the if statement's equality check syntax from '=' to '=='.
            
### FIX 8 ###
Line number: 18
Description: Closed the string in the print statement for 'Ozymandias'.
            
### FIX 9 ###
Line number: 20
Description: Fixed the for loop syntax by adding a colon at the end of the line.
            
### FIX 10 ###
Line number: 21
Description: Corrected the f-string in the print statement to include the correct variable syntax.
                  
Trial 2 - 3.736 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 1
Description: Fixed function definition by adding parentheses.
                                
### FIX 1 ###
Line number: 2
Description: Corrected the print statement by closing the string with a double quote.
                                
### FIX 2 ###
Line number: 5
Description: Fixed the range function call by removing extra parentheses.
                                
### FIX 3 ###
Line number: 9
Description: Closed the string in the print statement to terminate it properly.
                                
### FIX 4 ###
Line number: 10
Description: Changed assignment of 'x' to a valid statement.
                                
### FIX 5 ###
Line number: 12
Description: Fixed comparison in the name variable to use '=' instead of '==' for assignment.
                                
### FIX 6 ###
Line number: 13
Description: Corrected the comparison in the if statement to use '==' for equality check.
                                
### FIX 7 ###
Line number: 15
Description: Added a colon at the end of the for loop definition.
                                
### FIX 8 ###
Line number: 16 
Description: Corrected the print statement inside the for loop to properly format the string.  
                  
Trial 3 - 3.984 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 1
Description: Added parentheses to the function definition.
            
### FIX 1 ###
Line number: 3
Description: Fixed an unterminated string literal by closing the string in the print statement.
            
### FIX 2 ###
Line number: 5
Description: Corrected the range function to remove the extra parentheses.
            
### FIX 3 ###
Line number: 9
Description: Fixed an unterminated string literal in the print statement after the if condition.
            
### FIX 4 ###
Line number: 11
Description: Changed the assignment operator '==' to '=' when assigning the name variable.
            
### FIX 5 ###
Line number: 13
Description: Fixed the usage of the equality operator in the second if statement from '=' to '==' for comparison.
            
### FIX 6 ###
Line number: 15
Description: Corrected the statement in the for loop to add a colon at the end.
            
### FIX 7 ###
Line number: 17
Description: Fixed the print statement inside the for loop to include a missing '}' in the f-string.
                  

How does Dex handle 10 Ruby syntax errors at a time?

Code

num_computer_chips == 10

for i in 0..10
  print i
end

mr_robot = "Elliot

Tyrelk = "spiffy

if Tyrell = spiffy
  print "evil"
end

fsociety_members = ["Darlene", "Trenton", "Mobley"

if mr_robot == "Elliot"
  puts "Hello, friend
else
  puts "Goodbye, friend"
                  
Trial 1 - 3.185 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 1
Description: Changed '==' to '=' for variable assignment of 'num_computer_chips'.
            
### FIX 1 ###
Line number: 3
Description: Fixed range syntax for the 'for' loop.
            
### FIX 2 ###
Line number: 5
Description: Fixed missing quotation mark for 'mr_robot' assignment.
            
### FIX 3 ###
Line number: 7
Description: Corrected variable name from 'Tyrelk' to 'Tyrell'.
            
### FIX 4 ###
Line number: 9
Description: Changed assignment '=' to comparison '==' in the 'if' condition.
            
### FIX 5 ###
Line number: 10
Description: Fixed missing quotation mark for the string in the 'if' condition.
            
### FIX 6 ###
Line number: 12
Description: Added closing bracket for the 'fsociety_members' array.
            
### FIX 7 ###
Line number: 13
Description: Fixed missing quotation mark for the string in the 'puts' statement.
                  
Trial 2 - 3.077 seconds
Im sorry, I was unable to fix your code ;-(. Your code has not been changed. Please try again.
                  
Trial 3 - 3.055 seconds
Im sorry, I was unable to fix your code ;-(. Your code has not been changed. Please try again.
                  

How does Dex handle 10 Shell syntax errors at a time?

Code

name_one="Rick

name_two=="Morty

show="$name_one and name_two"

echo show

if [ name_one = "Rick" ];
    echo "Buuuuurp"
fi

for i in {1..5

    echo "Watching interdimensional cable"
done

therapy="Today" 

if [ $therapy = "Today" ] then 
    ech "Become a pickle" 
if
                  
Trial 1 - 3.294 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 1
Description: Fixed missing closing double quote for name_one.
            
### FIX 1 ###
Line number: 3
Description: Changed '==' to '=' in the assignment of name_two.
            
### FIX 2 ###
Line number: 5
Description: Added the missing dollar sign before name_two in the show variable.
            
### FIX 3 ###
Line number: 7
Description: Changed echo show to echo $show to correctly output the variable.
            
### FIX 4 ###
Line number: 9
Description: Added 'then' to the if statement checking if name_one is 'Rick'.
            
### FIX 5 ###
Line number: 12
Description: Closed the for loop with 'do' and added a semicolon and 'do' before the echo statement.
            
### FIX 6 ###
Line number: 15
Description: Corrected echo spelling from 'ech' to 'echo' in the last if statement.
            
### FIX 7 ###
Line number: 16
Description: Added 'then' to the if statement checking if therapy is 'Today'.
                  
Trial 2 - 4.200 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 1
Description: Fixed the string assignment for name_one by adding the missing closing quote.
            
### FIX 1 ###
Line number: 3
Description: Changed '==' to '=' in the assignment for name_two.
            
### FIX 2 ###
Line number: 5
Description: Corrected the variable expansion of name_two in the show variable assignment.
            
### FIX 3 ###
Line number: 7
Description: Added missing dollar sign before show in the echo statement.
            
### FIX 4 ###
Line number: 9
Description: Corrected the missing 'then' keyword after the if statement for checking name_one.
            
### FIX 5 ###
Line number: 11
Description: Fixed the for loop by adding the missing closing bracket.
            
### FIX 6 ###
Line number: 12
Description: Added 'do' keyword after the for statement.
            
### FIX 7 ###
Line number: 14
Description: Corrected the syntax error in the if statement for therapy by adding a missing 'then' keyword.
            
### FIX 8 ###
Line number: 15
Description: Fixed the typo in ech to echo at the line where 'Become a pickle' is printed.
                  
Trial 3 - 3.943 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 1
Description: Added closing double quote to the value of name_one.
            
### FIX 1 ###
Line number: 3
Description: Corrected equality check for name_two to use '=' instead of '==' and added double quotes.
            
### FIX 2 ###
Line number: 4
Description: Fixed variable reference in show to include the $ symbol for name_two.
            
### FIX 3 ###
Line number: 5
Description: Corrected the echo command to use $show to output the variable value.
            
### FIX 4 ###
Line number: 7
Description: Added 'then' to the if statement checking name_one.
            
### FIX 5 ###
Line number: 8
Description: Fixed the for loop by adding a closing brace '}' and using 'do'.
            
### FIX 6 ###
Line number: 10
Description: Added 'do' to the for loop definition.
            
### FIX 7 ###
Line number: 12
Description: Added spaces before and after the '=' in the if condition to correctly interpret the comparison.
            
### FIX 8 ###
Line number: 13
Description: Corrected the command 'ech' to 'echo' in the if statement checking therapy.
                  

How does Dex handle 1 Python error in 190 lines of code?

Code

#Credits: Pam Qian 2016 Fall CS 112 Python Midterm Project II
#https://gist.github.com/qianguigui1104/edb3b11b33c78e5894aad7908c773353
#Tic Tack Toe 

def main():
# The main function
    introduction = intro()
    board = create_grid()
    pretty = printPretty(board)
    symbol_1, symbol_2 = sym()
    full = isFull(board, symbol_1, symbol_2) # The function that starts the game is also in here.
    

def intro():
# This function introduces the rules of the game Tic Tac Toe
    print("Hello! Welcome to Pam's Tic Tac Toe game!")
    print("\n")
    print("Rules: Player 1 and player 2, represented by X and O, take turns "
          "marking the spaces in a 3*3 grid. The player who succeeds in placing "
          "three of their marks in a horizontal, vertical, or diagonal row wins.")
    print("\n")
    input("Press enter to continue.")
    print("\n")



def create_grid():
# This function creates a blank playboard
    print("Here is the playboard: ")
    board = [[" ", " ", " "],
             [" ", " ", " "],
             [" ", " ", " "]]        
    return board



def sym():
# This function decides the players' symbols
    symbol_1 = input("Player 1, do you want to be X or O? ")
    if symbol_1 == "X":
        symbol_2 = "O"
        print("Player 2, you are O. ")
    else:
        symbol_2 = "X"
        print("Player 2, you are X. ")
    input("Press enter to continue.")
    print("\n")
    return (symbol_1, symbol_2)



def startGamming(board, symbol_1, symbol_2, count):
# This function starts the game.

    # Decides the turn
    if count % 2 == 0:
        player = symbol_1
    elif count % 2 == 1:
        player = symbol_2
    print("Player "+ player + ", it is your turn. ")
    row = int(input("Pick a row:"
                    "[upper row: enter 0, middle row: enter 1, bottom row: enter 2]:"))
    column = int(input("Pick a column:"
                       "[left column: enter 0, middle column: enter 1, right column enter 2]"))


    # Check if players' selection is out of range
    while (row > 2 or row < 0) or (column > 2 or column < 0):
        outOfBoard(row, column)
        row = int(input("Pick a row[upper row:"
                        "[enter 0, middle row: enter 1, bottom row: enter 2]:"))
        column = int(input("Pick a column:"
                           "[left column: enter 0, middle column: enter 1, right column enter 2]"))

        # Check if the square is already filled
    while (board[row][column] == symbol_1)or (board[row][column] == symbol_2):
        filled = illegal(board, symbol_1, symbol_2, row, column)
        row = int(input("Pick a row[upper row:"
                        "[enter 0, middle row: enter 1, bottom row: enter 2]:"))
        column = int(input("Pick a column:"
                            "[left column: enter 0, middle column: enter 1, right column enter 2]"))    
        
    # Locates player's symbol on the board
    if player == symbol_1:
        board[row][column] = symbol_1
            
    else:
        board[row][column] = symbol_2
    
    return (board)



def isFull(board, symbol_1, symbol_2):
    count = 1
    winner = True
# This function check if the board is full
    while count < 10 and winner == True:
        gaming = startGamming(board, symbol_1, symbol_2, count)
        pretty = printPretty(board)
        
        if count == 9:
            print("The board is full. Game over.")
            if winner == True:
                print("There is a tie. ")

        # Check if here is a winner
        winner = isWinner(board, symbol_1, symbol_2, count)
        count += 1
    if winner == False:
        print("Game over.")
        
    # This is function gives a report 
    report(count, winner, symbol_1, symbol_2)



def outOfBoard(row, column):
# This function tells the players that their selection is out of range
    print("Out of boarder. Pick another one. ")
    
    

def printPretty(board):
# This function prints the board nice!
    rows = len(board)
    cols = len(board)
    print("---+---+---")
    for r in range(rows):
        print(board[r][0], " |", board[r][1], "|", board[r][2])
        print("---+---+---")
    return board



def isWinner(board, symbol_1, symbol_2, count):
# This function checks if any winner is winning
    winner = True
    # Check the rows
    for row in range (0, 3):
        if (board[row][0] == board[row][1] == board[row][2] == symbol_1):
            winner = False
            print("Player " + symbol_1 + ", you won!")
   
        elif (board[row][0] == board[row][1] == board[row][2] == symbol_2):
            winner = False
            print("Player " + symbol_2 + ", you won!")
            
            
    # Check the columns
    for col in range (0, 3):
        if (board[0][col] == board[1][col] == board[2][col] == symbol_1):
            winner = False
            print("Player " + symbol_1 + ", you won!")
        elif (board[0][col] == board[1][col] == board[2][col] == symbol_2):
            winner = False
            print("Player " + symbol_2 + ", you won!")

    # Check the diagnoals
    if board[0][0] == board[1][1] == board[2][2] == symbol_1:
        winner = False 
        print("Player " + symbol_1 + ", you won!")

    elif board[0][0] == board[1][1] == board[2][2] == symbol_2:
        winner = False
        print("Player " + symbol_2 + ", you won!")

    elif board[0][2] == board[1][1] == board[2][0] == symbol_1:
        winner = False
        print("Player " + symbol_1 + ", you won!")

    elif board[0][2] == board[1][1] == board[2][0] == symbol_2:
        winner = False
        print("Player " + symbol_2 + ", you won!")

    return winner


def illegal(board, symbol_1, symbol_2, row, column):
    print("The square you picked is already filled. Pick another one.")

    
def report(count, winner, symbol_1, symbol_2):
    print("\n")
    input("Press enter to see the game summary. ")
    if (winner == False) and (count % 2 == 1)
        print("Winner : Player " + symbol_1 + ".")
    elif (winner == False) and (count % 2 == 0 ):
        print("Winner : Player " + symbol_2 + ".")
    else:
        print("There is a tie. ")
                  
Trial 1 - 3.727 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 185
Description: Added missing colon at the end of the if statement.
                  
Trial 2 - 1.622 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 185
Description: Added missing colon to if statement
                  
Trial 3 - 2.195 seconds
✅ Your code has been fixed and your original file has been moved to dex-changed-files. Happy coding :-)!
### FIX 0 ###
Line number: 185
Description: Added a colon at the end of the if statement.