Skip to content

Instantly share code, notes, and snippets.

View khayyamsaleem's full-sized avatar
💭
working hard on https://play.lifeskills.software

khayyam khayyamsaleem

💭
working hard on https://play.lifeskills.software
View GitHub Profile
function isPasswordValid (input) {
if(!hasUppercase(input)) {
console.log('You need a capital letter');
}
if (!hasLowercase(input)) {
console.log('Password needs a lowercase letter');
}
import java.util.*;
public class GCD{
public static int gcd(int a, int b){
if (b==0) return a;
return gcd(b, a%b);
};
public static void main(String[] args){
<DOCTYPE! html>
<head>
<link rel=stylesheet type="text/css" href="style.css">
<script type="text/javascript" src="test.js"></script>
</head>
<body>
<p> Sample text </p>
</body>
</html>
@khayyamsaleem
khayyamsaleem / romanNum.java
Created January 26, 2017 00:40
converts integers to roman numeral representation
import java.util.Scanner;
public class romanNum {
public static String convert(int num){
int[] nums = new int[] {1000, 900, 500, 400, 100,
90, 50, 40, 10, 9, 5, 4, 1};
String[] letters = new String[] { "M", "CM", "D", "CD", "C", "XC",
"L", "XL", "X", "IX", "V", "IV", "I" };
String out = "";
int times = 0;
@khayyamsaleem
khayyamsaleem / Test.java
Created March 7, 2017 04:53
nick polich is a weenie
public class Test{
private static class Node<E extends Comparable<E>>{
E data;
Node<E> next;
public Node(E data){
this.data = data;
this.next = null;
}
}
@khayyamsaleem
khayyamsaleem / index.html
Created August 6, 2017 19:00
index.html with bootstrap included
<!doctype html>
<html>
<head>
<title>The Eye</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css">
</head>
<body>
<html>
<head>
<title>MY Times</title>
<link href="style.css" rel="stylesheet" type="text/css">
<header>
<div class="logo">
<img src="https://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-4/img-myt-logo.jpg">
<span>My Times</span>
</div>
<nav>
<!DOCTYPE html>
<html>
<head>
<title>MY Times</title>
<link href="style.css" rel="stylesheet" type="text/css">
<header>
<div class="logo">
<img src="https://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-4/img-myt-logo.jpg">
<span>My Times</span>
</div>
#The program should do the following:Prompt the user to select either Rock, Paper, or Scissors. Instruct the computer to randomly select either Rock, Paper, or Scissors. Compare the user's choice and the computer's choice. Determine a winner (the user or the computer). Inform the user who the winner is
from random import randint
from time import sleep
options = ["R", "P", "S"]
LOSS_MESSAGE = "You lost!"
WIN_MESSAGE = "You won!"
def decide_winner(user_choice, computer_choice):
print "You selected: %s" % user_choice
sleep(1)
#The program should do the following:Prompt the user to select either Rock, Paper, or Scissors. Instruct the computer to randomly select either Rock, Paper, or Scissors. Compare the user's choice and the computer's choice. Determine a winner (the user or the computer). Inform the user who the winner is
from random import randint
from time import sleep
options = ["R", "P", "S"]
LOSS_MESSAGE = "You lost!"
WIN_MESSAGE = "You won!"
def decide_winner(user_choice, computer_choice):
print "You selected: %s" % user_choice
sleep(1)