fork download
  1. #include <iostream>
  2. #include <thread>
  3. #include <chrono>
  4. #include <cmath>
  5. #include <vector>
  6.  
  7. using namespace std;
  8.  
  9. // Function to simulate a layer of the fusion pellet
  10. void printLayer(int layer, int maxLayer) {
  11. int width = maxLayer*2+1;
  12. for(int y=0; y<width; y++) {
  13. for(int x=0; x<width; x++) {
  14. int dist = abs(x - maxLayer) + abs(y - maxLayer);
  15. if(dist == layer) cout << "*"; // Fusion halo
  16. else if(dist < layer) cout << "O"; // Fuel pellet inner
  17. else cout << " "; // Empty space
  18. }
  19. cout << endl;
  20. }
  21. }
  22.  
  23. // Function to print alpha particles as arrows
  24. void printAlphaParticles() {
  25. vector<string> arrows = { " ^ ", " > ", " v ", " < "};
  26. cout << "Alpha particles emitted: ";
  27. for(auto a: arrows) cout << a;
  28. cout << endl;
  29. }
  30.  
  31. int main() {
  32. int maxLayer = 5; // Max fusion halo layers
  33. int delayMs = 500; // Delay between steps
  34.  
  35. cout << "=== Antimatter-Catalyzed Fusion Simulation ===\n";
  36. cout << "Energy Units: Antimatter (~1.88 GeV), Alpha (~3-8 MeV)\n\n";
  37.  
  38. for(int layer=0; layer<=maxLayer; layer++) {
  39. cout << "Step " << layer+1 << ": Fusion halo expanding...\n";
  40. printLayer(layer, maxLayer);
  41. printAlphaParticles();
  42. cout << "\n";
  43. this_thread::sleep_for(chrono::milliseconds(delayMs));
  44. }
  45.  
  46. cout << "Thrust / Energy Output achieved!\n";
  47. cout << "Antimatter energy released: ~1.88 GeV\n";
  48. cout << "Alpha particle energy released: ~" << 3 + rand()%6 << " MeV each\n";
  49. cout << "=== Simulation Complete ===\n";
  50.  
  51. return 0;
  52. }
  53.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
=== Antimatter-Catalyzed Fusion Simulation ===
Energy Units: Antimatter (~1.88 GeV), Alpha (~3-8 MeV)

Step 1: Fusion halo expanding...
           
           
           
           
           
     *     
           
           
           
           
           
Alpha particles emitted:  ^  >  v  < 

Step 2: Fusion halo expanding...
           
           
           
           
     *     
    *O*    
     *     
           
           
           
           
Alpha particles emitted:  ^  >  v  < 

Step 3: Fusion halo expanding...
           
           
           
     *     
    *O*    
   *OOO*   
    *O*    
     *     
           
           
           
Alpha particles emitted:  ^  >  v  < 

Step 4: Fusion halo expanding...
           
           
     *     
    *O*    
   *OOO*   
  *OOOOO*  
   *OOO*   
    *O*    
     *     
           
           
Alpha particles emitted:  ^  >  v  < 

Step 5: Fusion halo expanding...
           
     *     
    *O*    
   *OOO*   
  *OOOOO*  
 *OOOOOOO* 
  *OOOOO*  
   *OOO*   
    *O*    
     *     
           
Alpha particles emitted:  ^  >  v  < 

Step 6: Fusion halo expanding...
     *     
    *O*    
   *OOO*   
  *OOOOO*  
 *OOOOOOO* 
*OOOOOOOOO*
 *OOOOOOO* 
  *OOOOO*  
   *OOO*   
    *O*    
     *     
Alpha particles emitted:  ^  >  v  < 

Thrust / Energy Output achieved!
Antimatter energy released: ~1.88 GeV
Alpha particle energy released: ~4 MeV each
=== Simulation Complete ===