Tag Archives: Circle

How to display solid shapes in swiftUI?

By | October 6, 2024

Sometimes we need to display basic shapes in our apps just to get more attractive UI or just to highlight something. SwiftUI has several build in shapes to help the user to ease the development. It has several built-in shapes such as rectangles, circles, and capsules, each of which can be created, color, and positioned… Read More »

Problem: There are N prisoners standing in a circle, waiting to be executed…

By | June 27, 2023

There are N prisoners standing in a circle, waiting to be executed. The executions are carried out starting with the kth person, and removing every successive kth person going clockwise until there is no one left. Given N and k, write an algorithm to determine where a prisoner should stand in order to be the… Read More »

Introduction to Android Canvas – Simple Example

By | December 17, 2016

The Canvas can be used to draw graphics in android. It provides methods to draw oval, rectangle, picture, text, line etc. The Paint class is used with canvas to draw objects. It holds the information of color and style. In this example, we will draw some 2D Shapes. We will create class that extends View… Read More »