rendered paste body#!/usr/bin/ruby##roba che mi serve:volte_che_ho_vinto_scegliendo_la_busta_di_mike = 0volte_che_ho_vinto_tenendo_la_mia = 0volte_che_vince_mike_subito = 0quante_volte_lo_provo = 1000for i in 1..quante_volte_lo_provo#concorrentebusta_vincente = rand(3) + 1scelgo_la_busta_numero = rand(3) + 1#mikemike_apre_la_busta = 0while mike_apre_la_busta == 0 mike_apre_la_busta = rand(3) + 1 if (mike_apre_la_busta == scelgo_la_busta_numero) then mike_apre_la_busta = 0 endend#risultatiif busta_vincente == scelgo_la_busta_numero volte_che_ho_vinto_tenendo_la_mia = volte_che_ho_vinto_tenendo_la_mia + 1elsif busta_vincente == mike_apre_la_busta volte_che_vince_mike_subito = volte_che_vince_mike_subito + 1else volte_che_ho_vinto_scegliendo_la_busta_di_mike = volte_che_ho_vinto_scegliendo_la_busta_di_mike + 1endend #fine del forputs "Su " + quante_volte_lo_provo.to_sputs "Se mi tenevo la mia vincevo " + volte_che_ho_vinto_tenendo_la_mia.to_s + " volte."puts "Se prendevo quella di mike vincevo " + volte_che_ho_vinto_scegliendo_la_busta_di_mike.to_s + " volte."puts "Mike ha vinto subito " + volte_che_vince_mike_subito.to_s + " volte."