Hello Readers, Welcome to Coding by Learning !!! 😀 In this tutorial, we look at the code which creates a "Smiley Crush Game" similar to Candy Crush in Python language. Here You Go !! import pygame import random # --- Game Setup --- pygame.init() WIDTH, HEIGHT = 600 , 650 # extra space for score/moves ROWS, COLS = 8 , 8 CANDY_SIZE = WIDTH // COLS FPS = 60 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption( "Smiley Crush" ) # Fonts for text & smileys font = pygame.font.SysFont( "Arial" , 28 ) emoji_font = pygame.font.SysFont( "Segoe UI Emoji" , 48 ) # Emoji-friendly font # Smiley icons (candies) smileys = [ "😀" , "😂" , "😍" , "😎" , "😡" , "🤢" ] # Create board board = [[random.choice(smileys) for _ in range (COLS)] for _ in range (ROWS)] # Score and moves score = 0 moves = 0 # --- Load Sounds (replace with your own .wav or .ogg fi...
Hello Readers, Welcome to Coding by Learning !!! 😀 6. What is data type? As name says it defines type of data the value holds that can be stored in to variable 7. What are different data types available in VBA? VBA has multiple data types in order to handle data for the programming. Some of the major data types which often be used are: integer, single, long, double, range, date, variant, object 8. What is Variant data type? Variant is the special data type which can accept any type of data. Variable which is declared as variant will get data type based on the value it is assigned 9. How to declare a variable in VBA? Using Dim keyword variable will be declared in VBA. Syntax is : Dim VariableName As Datatype 10. Is it possible to declare a variable without data type in VBA? If yes, What data type it holds? It is possible. If developer declares a variable without mentioned any data type then it will be considered as variant data type. Happy learning & ...
Hello Readers, Welcome to Coding by Learning !!! 😀 This is one of the important formulae in excel application Vlookup function is used for the purpose of getting corresponding data for the given lookup value Syntax : =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]) Explanation : Lookup value is root value for which we are going to find corresponding data value, Table Array is the column range between lookup value column and corresponding data column Col index num is the count of total columns of table array finally range lookup, it is optional value which accepts TRUE (approximate match) or FALSE (Exact match) Let see with an example : Data sheet in the example work book has the detail of Indian states and its capital cities. Now look at the sheet named "Example". I have listed some of the Indian states here. Now I want to get the capital cities of respective states in the sheet. Lets use VLOOKUP formula as per syntax. Happy learning & Ha...
Comments
Post a Comment