Skip to content

Instantly share code, notes, and snippets.

View princesanjivy's full-sized avatar
:octocat:
code together grow together

Prince Sanjivy princesanjivy

:octocat:
code together grow together
View GitHub Profile
@princesanjivy
princesanjivy / main.py
Last active April 22, 2024 19:36
Test
"""Bagels, by Al Sweigart al@inventwithpython.com
A deductive logic game where you must guess a number based on clues.
This and other games are available at https://nostarch.com/XX
A version of this game is featured in the book, "Invent Your Own
Computer Games with Python" https://nostarch.com/inventwithpython
Tags: short, game, puzzle game"""
__version__ = 0
import random
NUM_DIGITS = 3 # (!) Try setting this to 1 or 10.
a=int(input("Enter the number of terms: "))
k=0
print("Enter",a,"terms: ")
for i in range(1,a+1):
ai=int(input())
@princesanjivy
princesanjivy / Main.java
Last active April 12, 2024 06:43
Test micro pattern printing
public class Main {
public static void main(String[] args) {
int rows = 5;
for (int i = 1; i <= rows; ++i) {
for (int j = 1; j <= i; ++j) {
@princesanjivy
princesanjivy / Main.java
Created April 11, 2024 16:29
Example micro-app program in Java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// Create a Scanner object to read input from the user
Scanner scanner = new Scanner(System.in);
// Ask the user to enter the first number
System.out.print("Enter the first number: ");
System.out.println("<get-input>");int num1 = scanner.nextInt();
@princesanjivy
princesanjivy / main.py
Created April 11, 2024 16:08
Micro example program
x = input("Type a number: ")
y = input("Type another number: ")
sum = int(x) + int(y)
print("The sum is: ", sum)
@princesanjivy
princesanjivy / main.dart
Last active April 12, 2024 18:02
Flutter Firebase CRUD operations with Provider example
import 'package:demo_project/provider/home_provider.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: const FirebaseOptions(
apiKey: "", // add your secrets here!