Ad
  • Custom User Avatar

    In the description, a, b, c, d are already defined variables(pointing to Player objects that have a .name method/property) where in your code, a, b, c, d must be undefined.

    For example, the Player objects in the description would be defined like this:

    Player = Struct.new(:name)
    a = Player.new('a')
    b = Player.new('b')
    c = Player.new('c')
    d = Player.new('d')
    
    # will print 'a'
    puts a.name
    # will throw undefined method since we never initialized e
    puts e.name