Posts

DIGITAL CLOCK

 In this blog I  will be providing you with the code of making a simple clock using C Language.I hope that you will like it.   CODE:-   #include<stdio.h> #include<stdlib.h> void print1(char *x[20]){ //This is the function for printing the output i.e. a day ahead. char *day[20]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"}; //above array is created to store the days. char *res[1];// this array is created to store the result. int i,flag,result; for(i=0;i<7;i++){     result=strcmp(x,day[i]);//This is used to compare two strings.If the two strings are same,then it will return a value0.*     if(result==0){         //* and if not then ,it will return a non zero number.         *res=*(day+i+1);         flag=1;     } } if(flag==1){     printf("%s",*res); }  ...

Circular linked List

 In this blog, I have provided you with the code of how can be dynamically create a circular linked list and how you can traverse,insert and delete in the linked list at the head,tail and at any index. IMPLEMENTATION IN C #include<stdio.h> #include<stdlib.h> struct student{     int marks;     struct student*next; }; int count; void display(struct student*head){     int i=0;     struct student*start;     start=head;     printf("Data of student %d is %d\n",i+1,start->marks);         i++;         start=start->next;     while(start!=head){         printf("Data of student %d is %d\n",i+1,start->marks);         i++;         start=start->next;              }   ...

SNAKE GAME IN PYTHON

 In this blog, I will provide you with the code of how to make simple snake game in     PYTHON. NOTE:- Before giving you all the code I would like to tell that there are some files in the code that I  have  created of my own and then running it like the file of high scores, and the background music. If you get an error, then don't panic just create the file of same name in your system or simply comment out that lines of code. Before running this code please install PYGAME AND PANDAS in your systems. SOURCE CODE     import  pygame import  random pygame.mixer.init() #colors white=( 255 , 255 , 255 ) red=( 255 , 0 , 0 ) black=( 0 , 0 , 0 ) pygame.init() screen_width= 900 screen_height= 600 gamewindow=pygame.display.set_mode((screen_width,screen_height)) bgimg=pygame.image.load( "snake.png" ) bgimg=pygame.transform.scale(bgimg,(screen_width,screen_height)).convert_alpha() # You can comment out these two lines  #or can install im...