Skip to content

Instantly share code, notes, and snippets.

from fsrs import *
from datetime import datetime
def print_scheduling_cards(scheduling_cards):
print("again.card:", scheduling_cards[Rating.Again].card.__dict__)
print("again.review_log:", scheduling_cards[Rating.Again].review_log.__dict__)
print("hard.card:", scheduling_cards[Rating.Hard].card.__dict__)
print("hard.review_log:", scheduling_cards[Rating.Hard].review_log.__dict__)
print("good.card:", scheduling_cards[Rating.Good].card.__dict__)
print("good.review_log:", scheduling_cards[Rating.Good].review_log.__dict__)
print("easy.card:", scheduling_cards[Rating.Easy].card.__dict__)
@karanahuja-android
karanahuja-android / sieveeratosthenes.kt
Created March 23, 2023 10:00
sieve of eratosthenes kotlin code
fun getPrime(n:Int){
val numArray = BooleanArray(n) {_ -> true}
var i = 2
while(i * i < n) {
//for each prime number less than square root of n :
if (numArray[i]) {
var j = i
while (j * i < n) {
//mark the multiples of that prime number as false . do this below n
numArray[j * i] = false
main ()
{
var computer = 1;
var player = 10;
if (computer > player)
{
print ("my number is higher");
}
if (computer < player)
{
import 'package:flutter/material.dart';
void main()
{
runApp(new HelloWorld());
}
class HelloWorld extends StatefulWidget {
@override
_HelloWorldState createState() => _HelloWorldState();
}
void main(){
var x = 1;
while (x < 101)
{
print (x);
x = x + 1;
}
}
1,2,fizz,4,5,fizz,7,8,fizz
import 'dart:io';
import 'dart:math';
main ()
{
Random r = Random ();
int computer = r.nextInt(11);
print ("please start guessing number");
while (true)
{
String playerstring = stdin.readLineSync ();
import 'dart:math';
import 'dart:io';
main ()
{
Random r = Random ();
int computer = r.nextInt (11);
String playerstr = stdin.readLineSync();
int player = int.parse (playerstr);
if (computer > player)
import 'dart:io';
class harryclass
{
dance ()
{
print ("dance");
}
}
main ()
main ()
{
var x = 3;
var y = 2;
print ("adding");
print (x+y);
print ("subtracting");
print (x-y);
print ("Multiplying");
print (x*y);
main ()
{
var computer = 2;
var player = 3;
if (computer > player)
{
print ("my number is higher");
}