Skip to main content

Posts

Alto's Adventure -An endless snowboarding odyssey

এক দশক ধরে স্মার্টফোনের জয়জয়কার চলছে। স্মার্টফোন শুধু কমিউনিকেশনের মাধ্যম থেকে পার হয়ে বহুদূর এগিয়ে গেছে। প্রজন্মের একটা বড় অংশ বিনোদনের প্রধান উপকরন হিসেবে স্মার্টফোনকে দেখে। সেই বিনোদনেরও একটা উপায় হলো মোবাইলে গেম খেলা। একটা বিশেষ গেমের সাথে পরিচয় করিয়ে দিতে লিখতে বসেছি। গেমটার নাম "Alto's Adventure"। ইতোমধ্যেই গেমটি বেশ সুনাম কুড়িয়েছে। গেমটা প্রমান দেয় যে একটা সফল গেমের জন্য ধুমন্ধার অ্যাকশন বা মগজের উপর জোর দেয়া, এই বিষয় গুলো না থাকলেও চলে। গেমের মুল থিমটা হলো স্নো বোর্ডিং। মূল নায়ক অলতোকে নিয়ে পাহাড়ে স্নো বোর্ডিং করতে হবে। কি? ইচ্ছা দমে গেলো? আসলেও স্নো বোর্ডিং বা এই ধরনের রিয়েল লাইফ গেম নিয়ে এর আগে হাজার হাজার গেম বানানো হয়েছে। তা এতে এমন কি আছে যে আলাদা ভাবে লিখতে হবে। আছে জনাব, তা অবশ্যই আছে। গেমটা খেলে প্রথম যেই চিন্তাটা মাথায় আসে তা হলো, এত রিল্যাক্সিং কি করে হতে পারে? তাও আবার একটা গেম? রিল্যাক্সিং হবার অন্যতম কারন হচ্ছে এর ব্যাকগ্রাউন্ড মিউজিক। পিয়ানোর ছন্দগুলো শুনলেই মনটা ভালো হয়ে যায়। তার সাথে বৃষ্টির সম সেটার আওয়াজ, বাজ পড়ার আওয়াজ ইত্যাদি পারিপার্শ্বিক...
Recent posts

How I Used a Classic Algorithm to Solve a Real-Life Restaurant Problem

Algorithms and data structures often feel like abstract, academic exercises when you first encounter them. Many of us in university wondered, Will I ever use this in real life? Fast forward to the working world, and the answer is often a resounding yes . Here’s a story of how I used Breadth-First Search (BFS), a classic algorithm, to solve a seemingly impossible problem for a restaurant inventory system. The Restaurant Dilemma Imagine you’re designing a system for a restaurant chain. The system needs to handle recipes, track ingredient usage, and calculate costs for menu items. Sounds straightforward, right? Let’s complicate it. Consider a dish like Lasagna. To make lasagna, you need: Pasta Sheets Bolognese Sauce Cheese But here’s the twist: Bolognese Sauce is itself a recipe that requires: Ground Meat Tomatoes Spices Every ingredient comes from an inventory with details like: Unit of Measurement (UOM) : Grams, Liters, etc. Cost per Unit : Calculated based on the last purchase price...

How to Make API Documentation the Easy Way with Postman

If you’re like me, you probably hate making API documentation. It’s boring, takes a lot of time, and feels like extra work. I used to skip it most of the time. But recently, I had no choice. I was working on a Web API that other software needed to use, and I had to make proper documentation. That’s when I found an easy solution:  Postman . Most of us already use Postman to test APIs, right? The good news is that Postman can now help you create documentation automatically with its AI tool. Here’s how you can do it. Steps to Create API Documentation in Postman Step 1: Add a Collection Description First, open Postman. On the left side, click on the  collection  you want to document. Go to the  Overview  tab and write a short description of your collection. This helps explain what your API is about. Overview page Step 2: Use AI to Write API Descriptions Select one of the API requests in your collection. On the right-hand side, click the  Documentation  ico...

Building a Tic Tac Toe Console Game in C#

When learning a new programming language, a common exercise is to create a classic game, such as Tic Tac Toe. In this post, I'll guide you through creating a simple, console-based Tic Tac Toe game in C#. First, let's start with the challenge we're trying to solve: Tic Tac Toe is a two-player game. We need to handle input from two players and alternate between them. The game is played on a 3x3 grid. We need to keep track of the state of this grid. A player wins by marking three spots in a row, either horizontally, vertically, or diagonally. The game continues until a player has won or all spots on the grid have been marked, in which case the game is a draw. To address these challenges, we need to develop a problem-solving mindset. Let's break down the problem into smaller, manageable pieces and think about how we could solve each one. This process is known as "decomposition" and it's a fundamental skill in programming and problem-solving in general. Step 1:...

Desktop Application Project: Building a Simple Library Management System in C#

 Let's create a simple library management system using the concepts we've covered throughout this series. The system will manage books, users, and borrow records. The project will include classes, inheritance, interfaces, events, delegates, generics, collections, LINQ, and exception handling. using System; using System.Collections.Generic; using System.Linq; // Chapter 2.1: Understanding classes, objects, and inheritance public class User { // Chapter 2.4: Understanding properties and indexers public int Id { get ; set ; } public string Name { get ; set ; } public DateTime JoinDate { get ; set ; } // Chapter 2.2: Understanding constructors and destructors public User( int id, string name) { Id = id; Name = name; JoinDate = DateTime.Now; } // Chapter 2.3: Understanding access modifiers (public, private, protected, internal) protected void PrintUserDetails() { Console.WriteLine( $ "ID: {I...

Chapter 6.4: Working with .NET Classes: Understanding System.Linq

 Introduction: In the previous article , Chapter 6.3, we discussed the System.Collections and System.Collections.Generic namespaces, which provide classes for working with collections of objects in C# applications. In this final article of our series, we'll explore the System.Linq namespace, which offers powerful querying capabilities for collections, allowing you to filter, sort, and transform data with ease. After completing this article, you should have a solid understanding of C# and its core concepts. We encourage you to start a project to implement what you've learned and further strengthen your skills. System.Linq Namespace: The System.Linq namespace provides Language Integrated Query (LINQ) functionality, which allows you to perform complex queries on collections using a concise and expressive syntax. LINQ works with both generic and non-generic collections, as well as with other data sources like XML and relational databases. Some key features of LINQ include: ...

Chapter 6.3: Working with .NET Classes: Understanding System.Collections and System.Collections.Generic

 Introduction: In the previous article , Chapter 6.2, we explored the System.Text and System.Text.Encoding namespaces, which are important for working with text and character encodings in C# applications. In this article, we'll discuss the System.Collections and System.Collections.Generic namespaces, which provide classes for working with collections of objects. In the next article, we'll dive into the System.Linq namespace, which offers powerful querying capabilities for collections. System.Collections Namespace: The System.Collections namespace provides non-generic collection classes, such as ArrayList, Hashtable, and Queue. These classes store objects, but they don't enforce type safety: ArrayList list = new ArrayList(); list.Add(42); list.Add( "Hello, world!" ); foreach ( object item in list) { // Process item } System.Collections.Generic Namespace: The System.Collections.Generic namespace offers type-safe, generic collection classe...

Chapter 6.2: Working with .NET Classes: Understanding System.Text and System.Text.Encoding

 Introduction: In the previous article , Chapter 6.1, we discussed the System.IO namespace, which provides classes for working with files, directories, and streams. In this article, we'll explore the System.Text and System.Text.Encoding namespaces, which are important for working with text and character encodings in C# applications. In the next article, we'll discuss the System.Collections and System.Collections.Generic namespaces, which are essential for working with collections of objects. System.Text Namespace: The System.Text namespace contains classes and interfaces for working with text and character encodings. Some key classes include: StringBuilder: Provides a mutable string buffer for efficient string manipulation. Encoding: Represents a character encoding, such as UTF-8, UTF-16, or UTF-32. Decoder/Encoder: Convert between different character encodings and byte arrays. StringBuilder: The StringBuilder class is useful for efficient string manipula...