Skip to content

Instantly share code, notes, and snippets.

@70V07 70V07/pnd.cpp
Created Jan 23, 2019

Embed
What would you like to do?
A small old code
// pnd since: 4/5/2014 by Marco Colonna TOVOT
// license ∀n: https://arbitrio.altervista.org/arbitrio-license/
#include <conio.h>
#include <cstdlib>
#include <stdlib.h>
#include <iostream>
#include <windows.h>
using namespace std;
void SetColor(short Color)
{
HANDLE hCon=GetStdHandle (STD_OUTPUT_HANDLE);
SetConsoleTextAttribute (hCon,Color);
}
int main(int argc, char *argv[]){
/////////////////////////////////////////////// Dichiarazione delle VARIABILI //
// DECISIVO //----------------------------------------------------------------//
double D;
//----------------------------------------------------------------------------//
// PERCENTUALI (xxx) //-------------------------------------------------------//
double pSunrise, pDay, pSunset, pNight, pInteriorDay, pInteriorNight;
//----------------------------------------------------------------------------//
// TEMPORALI (x.x) //---------------------------------------------------------//
double Sunrise, Day, Sunset, Night, InteriorDay, InteriorNight;
//----------------------------------------------------------------------------//
//+++++++++++++++++++++++++++++++++++++++++++++++++++// DETERMINARE+ELABORARE //
// DISCLAIMER //--------------------------------------------------------------//
SetColor (12);
printf(" \n"); _beep(25,70);
printf(" PND by Marco Colonna \n"); _beep(100,70);
SetColor (6);
printf(" ___________________________________________ \n"); _beep(150,63);
printf(" \n"); _beep(200,55);
SetColor (9);
printf(" Is obvious the copyright and similar \n"); _beep(250,55);
printf(" is useless for this little file... \n"); _beep(300,55);
printf(" \n"); _beep(250,65);
printf(" \n"); _beep(300,75);
SetColor (8);
printf(" Share free whit \n"); _beep(250,60);
printf(" Reciproc Respect \n"); _beep(300,60);
printf(" TOVOT creation \n");
printf(" since 4/5/2014 \n");
printf(" \n"); _beep(250,60);
SetColor (12);
printf(" Respecting the CUBICaccuracy... \n"); _beep(300,60);
printf(" ___________________________________________ \n"); _beep(350,66);
SetColor (15);
printf(" \n"); _beep(100,100);
printf("---------------------------------------------\n");
//----------------------------------------------------------------------------//
// DECISIVO, PERCENTUALI, VALORI //-------------------------------------------//
SetColor (8);
printf(" 1 to Sunrise \n");
printf(" 2 to Day \n");
printf(" 3 to Sunset \n");
printf(" 4 to Night \n");
printf(" 5 to InterionDay \n");
printf(" 6 to InteriorNight \n");
SetColor (15);
printf("---------------------------------------------\n");
cout<<" [STEP1] Choose the decisive moment: " ;
SetColor (2);
cin>>D ;
SetColor (15);
printf("---------------------------------------------\n");
//--------------------------------START-OPPURE--------------------------------//
if (D==1) { pSunrise=100 ;
printf(" [STEP2] Decisive moment! \n");
SetColor (14);
printf(" SUNRISE \n");
printf(" PND Set the percentage at 100%% \n");
SetColor (15);
printf(" \n");
cout<<" Set the variable (x.x): " ;
SetColor (14);
cin>>Sunrise ;
SetColor (15);
printf(" \n");
printf("---------------------------------------------\n");
printf(" NOW, OTHERS percentage ... \n");
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2a] \n");
SetColor (14);
printf(" DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pDay ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2b] \n");
SetColor (14);
printf(" SUNSET \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pSunset ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2c] \n");
SetColor (14);
printf(" NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pNight ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2d] \n");
SetColor (14);
printf(" Int.DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorDay ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2e] \n");
SetColor (14);
printf(" Int.NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorNight ;
printf(" %% \n");
SetColor (15);
//============================================================================//
printf("---------------------------------------------\n");
printf(" \n");
printf("---------------DATA-PROCESSING---------------\n");
printf("---------------------------------------------\n");
SetColor (14);
printf(" [" );
Day = ( Sunrise / pSunrise ) * pDay;
printf( "IIIII" ); _beep(450, 255);
Sunset = ( Sunrise / pSunrise ) * pSunset;
printf( "IIIIII" ); _beep(600, 255);
Night = ( Sunrise / pSunrise ) * pNight;
printf( "IIIIIII" ); _beep(606, 255);
InteriorDay = ( Sunrise / pSunrise ) * pInteriorDay;
printf( "IIIIIIIII" ); _beep(666, 255);
InteriorNight = ( Sunrise / pSunrise ) * pInteriorNight;
printf( "] D.P. COMPLETE \n"); _beep(755, 255);
SetColor (15);
}
//-----------------------------------OPPURE-----------------------------------//
if (D==2) { pDay=100 ;
printf(" [STEP2] Decisive moment! \n");
SetColor (14);
printf(" DAY \n");
printf(" PND Set the percentage at 100%% \n");
SetColor (15);
printf(" \n");
cout<<" Set the variable (x.x): " ;
SetColor (14);
cin>>Day ;
SetColor (15);
printf(" \n");
printf("---------------------------------------------\n");
printf(" NOW, OTHERS percentage ... \n");
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2a] \n");
SetColor (14);
printf(" SUNRISE \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pSunrise ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2b] \n");
SetColor (14);
printf(" SUNSET \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pSunset ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2c] \n");
SetColor (14);
printf(" NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pNight ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2d] \n");
SetColor (14);
printf(" Int.DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorDay ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2e] \n");
SetColor (14);
printf(" Int.NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorNight ;
printf(" %% \n");
SetColor (15);
//============================================================================//
printf("---------------------------------------------\n");
printf(" \n");
printf("---------------DATA-PROCESSING---------------\n");
printf("---------------------------------------------\n");
SetColor (14);
printf(" [" );
Sunrise = ( Day / pDay ) * pSunrise;
printf( "IIIII" ); _beep(450, 255);
Sunset = ( Day / pDay ) * pSunset;
printf( "IIIIII" ); _beep(600, 255);
Night = ( Day / pDay ) * pNight;
printf( "IIIIIII" ); _beep(606, 255);
InteriorDay = ( Day / pDay ) * pInteriorDay;
printf( "IIIIIIIII" ); _beep(666, 255);
InteriorNight = ( Day / pDay ) * pInteriorNight;
printf( "] D.P. COMPLETE \n"); _beep(755, 255);
SetColor (15);
}
//-----------------------------------OPPURE-----------------------------------//
if (D==3) { pSunset=100 ;
printf(" [STEP2] Decisive moment! \n");
SetColor (14);
printf(" SUNSET \n");
printf(" PND Set the percentage at 100%% \n");
SetColor (15);
printf(" \n");
cout<<" Set the variable (x.x): " ;
SetColor (14);
cin>>Sunset ;
SetColor (15);
printf(" \n");
printf("---------------------------------------------\n");
printf(" NOW, OTHERS percentage ... \n");
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2a] \n");
SetColor (14);
printf(" SUNRISE \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>Sunrise ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2b] \n");
SetColor (14);
printf(" DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pDay ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2c] \n");
SetColor (14);
printf(" NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pNight ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2d] \n");
SetColor (14);
printf(" Int.DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorDay ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2e] \n");
SetColor (14);
printf(" Int.NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorNight ;
printf(" %% \n");
SetColor (15);
//============================================================================//
printf("---------------------------------------------\n");
printf(" \n");
printf("---------------DATA-PROCESSING---------------\n");
printf("---------------------------------------------\n");
SetColor (14);
printf(" [" );
Sunrise = ( Sunset / pSunset ) * pSunrise;
printf( "IIIII" ); _beep(450, 255);
Sunset = ( Sunset / pSunset ) * pSunset;
printf( "IIIIII" ); _beep(600, 255);
Night = ( Sunset / pSunset ) * pNight;
printf( "IIIIIII" ); _beep(606, 255);
InteriorDay = ( Sunset / pSunset ) * pInteriorDay;
printf( "IIIIIIIII" ); _beep(666, 255);
InteriorNight = ( Sunset / pSunset ) * pInteriorNight;
printf( "] D.P. COMPLETE \n"); _beep(755, 255);
SetColor (15);
}
//-----------------------------------OPPURE-----------------------------------//
if (D==4) { pNight=100 ;
printf(" [STEP2] Decisive moment! \n");
SetColor (14);
printf(" NIGHT \n");
printf(" PND Set the percentage at 100%% \n");
SetColor (15);
printf(" \n");
cout<<" Set the variable (x.x): " ;
SetColor (14);
cin>>Night ;
SetColor (15);
printf(" \n");
printf("---------------------------------------------\n");
printf(" NOW, OTHERS percentage ... \n");
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2a] \n");
SetColor (14);
printf(" SUNRISE \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pSunrise ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2b] \n");
SetColor (14);
printf(" DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pDay ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2c] \n");
SetColor (14);
printf(" SUNSET \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pSunset ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2d] \n");
SetColor (14);
printf(" Int.DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorDay ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2e] \n");
SetColor (14);
printf(" Int.NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorNight ;
printf(" %% \n");
SetColor (15);
//============================================================================//
printf("---------------------------------------------\n");
printf(" \n");
printf("---------------DATA-PROCESSING---------------\n");
printf("---------------------------------------------\n");
SetColor (14);
printf(" [" );
Sunrise = ( Night / pNight ) * pSunrise;
printf( "IIIII" ); _beep(450, 255);
Day = ( Night / pNight ) * pDay;
printf( "IIIIII" ); _beep(600, 255);
Sunset = ( Night / pNight ) * pSunset;
printf( "IIIIIII" ); _beep(606, 255);
InteriorDay = ( Night / pNight ) * pInteriorDay;
printf( "IIIIIIIII" ); _beep(666, 255);
InteriorNight = ( Night / pNight ) * pInteriorNight;
printf( "] D.P. COMPLETE \n"); _beep(755, 255);
SetColor (15);
}
//-----------------------------------OPPURE-----------------------------------//
if (D==5) { pInteriorDay=100 ;
printf(" [STEP2] Decisive moment! \n");
SetColor (14);
printf(" Int.DAY \n");
printf(" PND Set the percentage at 100%% \n");
SetColor (15);
printf(" \n");
cout<<" Set the variable (x.x): " ;
SetColor (14);
cin>>InteriorDay ;
SetColor (15);
printf(" \n");
printf("---------------------------------------------\n");
printf(" NOW, OTHERS percentage ... \n");
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2a] \n");
SetColor (14);
printf(" SUNRISE \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pSunrise ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2b] \n");
SetColor (14);
printf(" DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pDay ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2c] \n");
SetColor (14);
printf(" SUNSET \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pSunset ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2d] \n");
SetColor (14);
printf(" NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pNight ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2e] \n");
SetColor (14);
printf(" Int.NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorNight ;
printf(" %% \n");
SetColor (15);
//============================================================================//
printf("---------------------------------------------\n");
printf(" \n");
printf("---------------DATA-PROCESSING---------------\n");
printf("---------------------------------------------\n");
SetColor (14);
printf(" [" );
Sunrise = ( InteriorDay / pInteriorDay ) * pSunrise;
printf( "IIIII" ); _beep(450, 255);
Day = ( InteriorDay / pInteriorDay ) * pDay;
printf( "IIIIII" ); _beep(600, 255);
Sunset = ( InteriorDay / pInteriorDay ) * pSunset;
printf( "IIIIIII" ); _beep(606, 255);
Night = ( InteriorDay / pInteriorDay ) * pNight;
printf( "IIIIIIIII" ); _beep(666, 255);
InteriorNight = ( InteriorDay / pInteriorDay ) * pInteriorNight;
printf( "] D.P. COMPLETE \n"); _beep(755, 255);
SetColor (15);
}
//-----------------------------------OPPURE-----------------------------------//
if (D==6) { pInteriorNight=100 ;
printf(" [STEP2] Decisive moment! \n");
SetColor (14);
printf(" Int.NIGHT \n");
printf(" PND Set the percentage at 100%% \n");
SetColor (15);
printf(" \n");
cout<<" Set the variable (x.x): " ;
SetColor (14);
cin>>InteriorNight ;
SetColor (15);
printf(" \n");
printf("---------------------------------------------\n");
printf(" NOW, OTHERS percentage ... \n");
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2a] \n");
SetColor (14);
printf(" SUNRISE \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pSunrise ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2b] \n");
SetColor (14);
printf(" DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pDay ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2c] \n");
SetColor (14);
printf(" SUNSET \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pSunset ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2d] \n");
SetColor (14);
printf(" NIGHT \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pNight ;
printf(" %% \n");
SetColor (15);
printf("---------------------------------------------\n");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
printf(" [STEP2e] \n");
SetColor (14);
printf(" Int.DAY \n");
SetColor (15);
cout<<" Set the percentage (xxx): " ;
SetColor (14);
cin>>pInteriorDay ;
printf(" %% \n");
SetColor (15);
//============================================================================//
printf("---------------------------------------------\n");
printf(" \n");
printf("---------------DATA-PROCESSING---------------\n");
printf("---------------------------------------------\n");
SetColor (14);
printf(" [" );
Sunrise = ( InteriorNight / pInteriorNight ) * pSunrise;
printf( "IIIII" ); _beep(450, 255);
Day = ( InteriorNight / pInteriorNight ) * pDay;
printf( "IIIIII" ); _beep(600, 255);
Sunset = ( InteriorNight / pInteriorNight ) * pSunset;
printf( "IIIIIII" ); _beep(606, 255);
Night = ( InteriorNight / pInteriorNight ) * pNight;
printf( "IIIIIIIII" ); _beep(666, 255);
InteriorDay = ( InteriorNight / pInteriorNight ) * pInteriorDay;
printf( "] D.P. COMPLETE \n"); _beep(755, 255);
SetColor (15);
}
//-----------------------------------STOPPURE---------------------------------//
//===============================================================// RISULTATI //
printf("---------------------------------------------\n");
printf("-------------------RESULTS-------------------\n");
printf(" \n");
SetColor (14);
printf(" Sunrise : %4.2f \n" ,Sunrise);
SetColor (15);
printf(" %4.2f%% \n" ,pSunrise);
printf(" \n");
SetColor (14);
printf(" Day : %4.2f \n" ,Day);
SetColor (15);
printf(" %4.2f %% \n" ,pDay);
printf(" \n");
SetColor (14);
printf(" Sunset : %4.2f \n" ,Sunset);
SetColor (15);
printf(" %4.2f %% \n" ,pSunset);
printf(" \n");
SetColor (14);
printf(" Night : %4.2f \n" ,Night);
SetColor (15);
printf(" %4.2f %% \n" ,pNight);
printf(" \n");
SetColor (14);
printf(" Int.Day : %4.2f \n" ,InteriorDay);
SetColor (15);
printf(" %4.2f %% \n" ,pInteriorDay);
printf(" \n");
SetColor (14);
printf(" Int.Night : %4.2f \n" ,InteriorNight);
SetColor (15);
printf(" %4.2f %% \n" ,pInteriorNight);
printf(" \n");
printf("---------------------------------------------\n");
printf(" SEE YOU LATER AT NEXT PROCESS \n");
printf("---------------------------------------------\n");
system("PAUSE");
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.