Migrate ttt_v1.rb into new version with AI