This repository hosts all home and lab assignments for the CSE 102: Structured Programming Language Sessional course, a part of the Term-1, Level-1 curriculum. The coursework builds upon the foundational theories from CSE 101 and applies them to real-world problem-solving. Additionally, the course introduces igraphics, an OpenGL-based library, for creating animations, culminating in a term project.
- Offline-1: Focuses on 1D Arrays.
- Offline-2: Explores 2D Arrays and Strings.
Each lab assignment delves into key concepts of structured programming:
-
: Branching and Basic Arithmetic
- Problem 1: Determining the intersection point of two lines.
- Problem 2: Evaluating whether a given point lies on, inside, or outside a circle based on its radius and center.
-
- Problem 1: Printing specific star patterns.
- Problem 2: Calculating the LCM dynamically as new numbers are added (without arrays).
-
- Sorting numbers based on the number of
1s
in their binary representation, with ties resolved using factor numbers.
- Sorting numbers based on the number of
-
: Array, Strings, and Recursion
- Identifying the presence and frequency of a substring within a given string.
-
- Problem 1: Implementing a structure to multiply and divide complex numbers.
- Problem 2: Concatenating two strings using pointers (without built-in string functions).
A unique assignment involving sine and cosine curves, where users can dynamically adjust the wavelength and amplitude of the curves.
"Catch the Egg" is an engaging and interactive game developed as the capstone project for this course. It showcases the use of igraphics for graphical programming and introduces students to the basics of game development.
- Graphics and Animation: Smooth animations and visually appealing graphics powered by the igraphics library.
- User Interaction: Players control a basket using keyboard inputs to catch falling eggs.
- Score Tracking: The game tracks the player's score, which increases with each successful catch.
- Increasing Difficulty: The speed and frequency of falling eggs increase progressively, adding to the challenge.
igraphics is a lightweight and educational graphics library built on OpenGL. It provides an intuitive interface for creating graphical applications, making it an excellent tool for beginners.
This project not only enhances programming skills but also introduces students to the fundamentals of game development and graphical programming, offering a comprehensive and enjoyable learning experience.
Feel free to explore the repository and dive into the code to see how these concepts were implemented!