Christmas Code Fun
Hello World!
Merry Christmas from all of us at #CodeZone</>!
We hope you have the best of fun as you code your way to the New Year 2020.
We decided to post our first code on this blog on this day to party our way with those celebrating. We hope you like it!
CodeZone Christmas Code:
//#CodeZone Christmas Code#include <stdio.h>#include <stdbool.h>void pause();void merryChristmas();void takeCoffee();void continueCoding();void newYear(int year);int main(){ int i = 1, day; printf("\nWhat is the date today? [Only the day e.g: 25]\n"); scanf("%d",&day); if(day<25) { continueCoding(); } else if(day == 25) { bool christmas = true; pause(); while(christmas == true) { merryChristmas(); if(i==6) { break; } i++; } takeCoffee(); continueCoding(); } else newYear(2020); return 0;}void pause(){ printf("\n"); int i, msg[]={80, 108, 101, 97, 115, 101, 32, 114, 101, 115, 116, 32, 97, 110, 100, 32, 104, 97, 118, 101, 32, 115, 111, 109, 101, 32, 114, 101, 102, 114, 101, 115, 104, 109, 101, 110, 116, 115, 33}; for (i=0;i<39;i++) { printf("%c", msg[i]); } printf("\n");}void merryChristmas(){ printf("\n"); int i, msg[]={77, 101, 114, 114, 121, 32, 67, 104, 114, 105, 115, 116, 109, 97, 115, 33}; for (i=0;i<16;i++) { printf("%c", msg[i]); }}void takeCoffee(){ printf("\n\n"); int i, msg[]={72, 101, 114, 101, 39, 115, 32, 115, 111, 109, 101, 32, 67, 111, 102, 102, 101, 101}; for (i=0;i<18;i++) { printf("%c", msg[i]); } printf("\n");}void continueCoding(){ printf("\n"); int i, msg[]={67, 111, 110, 116, 105, 110, 117, 101, 32, 99, 111, 100, 105, 110, 103, 46, 46, 46}; for (i=0;i<18;i++) { printf("%c", msg[i]); } printf("\n");}void newYear(int year){ printf("\n"); int i, msg[]={35, 67, 111, 100, 101, 90, 111, 110, 101, 32, 119, 105, 115, 104, 101, 115, 32, 121, 111, 117}; for (i=0;i<20;i++) { printf("%c", msg[i]); } printf(" "); int msg2[]={97, 32, 72, 97, 112, 112, 121, 32, 78, 101, 119, 32, 89, 101, 97, 114, 32, 50, 48, 50, 48, 33}; for (i=0;i<22;i++) { printf("%c", msg2[i]); } printf("\n"); printf("\n"); int msg3[]={67, 111, 110, 116, 105, 110, 117, 101, 32, 99, 111, 100, 105, 110, 103, 46, 46, 46}; for (i=0;i<18;i++) { printf("%c", msg3[i]); } printf("\n");}
Output:
In case you want to have the source code, here’s the .docx file you can download for yourself.
Cheers!
So amazing
Thank you!
May the sparkle and joy of Christmas fill your hearts I wish everyone at Codezone a season filled with happiness and merry-making. Merry Christmas to you and your family