4 ms·
They obviously cant do that. They are not trained to do that. But on the other hand, devstral:24b spit out a solution for the tower of hanoi in under a minute.
by throwawayffffas 1y ago
They obviously cant do that. They are not trained to do that. But on the other hand, devstral:24b spit out a solution for the tower of hanoi in under a minute.
def move_disk(start_peg, end_peg, disk):
print(f"Moving disk {disk} from {start_peg} to {end_peg}")
return disk
def towers_of_hanoi(n, source, auxiliary, target, delay=0.5):
if n == 1:
move_disk(source, target, 1)
return
towers_of_hanoi(n-1, source, target, auxiliary, delay)
move_disk(source, target, n)
towers_of_hanoi(n-1, auxiliary, source, target, delay)
if __name__ == "__main__":
n = int(input("Enter the number of disks: "))
towers_of_hanoi(n, 'A', 'B', 'C')
So it can actually solve it. But in the way it was trained to.
- chrisjj 1y ago> So it can actually solve it. By executing its code, you mean?