DNA Converter

This is a program that converts the DNA to RNA, amino acid, and protein. It asks the user for its DNA.

Guessing Game

The goal of this game is to guess the number chosen by the CPU between 1-100 in at most 5 tries, along with hints for help.

Guessing Game

The computer will randomly generate a random number from 1-100, that the user will have 5 tries to guess. After each guess the user will have a chance to get a hint as well.

DNA TO RNA CONVERTER

This is a python based DNA converter which converts the DNA to RNA to amino acid chains

sequence = int(input("Enter the length you want the sequence to be")) from random import randint DNA = ["A" , "T" , "C" , "G"] data = [] dnaString = "" for p in range (0,sequence): randomVal = randint(0, len(DNA) -1) x = DNA[randomVal] dnaString = dnaString + x rnaString = "" for x in range(0,len(dnaString), 1): letter = dnaString[x] if letter == "A": rnaString = rnaString + "U" if letter == "T": rnaString = rnaString + "A" if letter == "C": rnaString = rnaString + "G" if letter == "G": rnaString = rnaString + "C" # the variable in the for loop is a representative of the index for b in range(0,len(rnaString), 3): codon = rnaString[b:b+3] print(codon) if codon == ("GCA" or codon == "GCC" or codon == "GCG" or codon =="GCU"): rnaString = rnaString + "A" if codon == ("UGC" or codon == "UGU"): rnaString = rnaString + "C" if codon == ("GAC" or codon == "GAU"): rnaString = rnaString + "D" if codon == ("GAA" or codon == "GAG"): rnaString = rnaString + "E" if codon == ("UUC" or codon == "UUU"): rnaString == rnaString + "F" if codon == ("GGA" or codon == "GGC" or codon == "GGG" or codon == "GGU"): rnaString = rnaString + "G" if codon == ("CAC" or codon == "CAU"): rnaString = rnaString + "H" if codon == ("AUA" or codon == "AUC" or codon == "AUU"): rnaString = rnaString + "I" if codon == ("AAA" or codon == "AAG"): rnaString = rnaString + "K" if codon == ("UUA" or codon == "UUG" or codon == "CUA" or codon == "CUC" or codon == "CUG" or codon =="CUU"): rnaString = rnaString + "L" if codon == ("AUG"): rnastring = rnaString + "M" if codon == ("AAC" or codon == "AAU"): rnaString = rnaString + "N" if codon == ("CCA" or codon == "CCC" or codon == "CCG" or codon == "CCU"): rnaString = rnaString + "P" if codon == ("CAA" or codon == "CAG"): rnaString = rnaString + "Q" if codon == ("AGA" or codon == "AGG" or codon == "CGA" or codon == "CGC" or codon == "CGG" or codon == "CGU"): rnaString = rnaString + "R" if codon == ("AGC" or codon == "AGU" or codon == "UCA" or codon == "UCC" or codon == "UCG" or codon == "UCU"): rnaString = rnaString + "S" if codon == ("ACA" or codon == "ACC" or codon == "ACG" or codon == "ACU"): rnaString = rnaString + "T" if codon == ("GUA" or codon == "GUC" or codon == "GUG" or codon == "GUU"): rnaString = rnaString + "V" if codon == ("UGG"): rnaString = rnaString + "W" if codon == ("UAC" or codon == "UAU"): rnaString = rnaString + "Y"

Battleship

This game is made with python and is very simple. You are first asked what position to paste your ships. Then you are trying to guess all of the computer's ships before it guesses yours.

import random var = False varo = False x = [] y = [] yx = [] yy = [] removex = [] removey = [] stuff = 0 stuffy = 0 graph1 = ["", "", "", "", ""] graph2 = ["", "", "", "", ""] graph3 = ["", "", "", "", ""] graph4 = ["", "", "", "", ""] graph5 = ["", "", "", "", ""] ograph1 = ["", "", "", "", ""] ograph2 = ["", "", "", "", ""] ograph3 = ["", "", "", "", ""] ograph4 = ["", "", "", "", ""] ograph5 = ["", "", "", "", ""] for i in range(0, 5, 1): ranx = random.randint(1, 5) rany = random.randint(1, 5) if len(x) > 0: for a in range(1, len(x), 1): while ranx == x[i - a] and rany == y[i - a]: ranx = random.randint(1, 5) x.append(ranx) y.append(rany) savex = 0 savey = 0 print(x) print(y) place1x = int(input("what x coordinate would you like to place your first ship?")) place1y = int(input("what y coordinate would you like to place your first ship?")) while place1x > 5 or place1x < 1: place1x = int(input("Please try again. what x coordinate would you like to place your first ship?")) place1y = int(input("please try again. what y coordinate would you like to place your first ship?")) yx.append(place1x) yy.append(place1y) place2x = int(input("what x coordinate would you like to place your second ship?")) place2y = int(input("what y coordinate would you like to place your second ship?")) while place2x > 5 or place2x < 1: place2x = int(input("Try agian. what x coordinate would you like to place your second ship?")) place2y = int(input("Try again what y coordinate would you like to place your second ship?")) yx.append(place2x) yy.append(place2y) place3x = int(input("what x coordinate would you like to place your third ship?")) place3y = int(input("what y coordinate would you like to place your third ship?")) while place3x > 5 or place3x < 1: place3x = int(input("Try again. what x coordinate would you like to place your third ship?")) place3y = int(input("Try agian. what y coordinate would you like to place your third ship?")) yx.append(place3x) yy.append(place3y) place4x = int(input("what x coordinate would you like to place your fourth ship?")) place4y = int(input("what y coordinate would you like to place your fourth ship?")) while place4x > 5 or place4x < 1: place4x = int(input("Try again. what x coordinate would you like to place your fourth ship?")) place4y = int(input("Try again. what y coordinate would you like to place your fourth ship?")) yx.append(place4x) yy.append(place4y) place5x = int(input("what x coordinate would you like to place your fifth ship?")) place5y = int(input("what y coordinate would you like to place your fifth ship?")) while place5x > 5 or place5x < 1: place5x = int(input("Try again. what x coordinate would you like to place your fifth ship?")) place5y = int(input("Try again. what y coordinate would you like to place your fifth ship?")) yx.append(place5x) yy.append(place5y) var1 = False var1o = False things = True thingso = True while things and thingso: if x[0] + x[1] + x[2] + x[3] + x[4] == 0: things = False break print("Opponents graph") print(graph1) print(graph2) print(graph3) print(graph4) print(graph5) print("Your graph") print(ograph1) print(ograph2) print(ograph3) print(ograph4) print(ograph5) guessx = int(input("choose an x coordinate")) guessy = int(input("choose an y coordinate")) # player guess check for index in range(len(x)): if guessx == x[index] and guessy == y[index]: var = True savex = x[index] savey = y[index] x[index] = 0 y[index] = 0 if var: var1 = True var = False # opponent guess check eguessx = random.randint(1, 5) eguessy = random.randint(1, 5) print(eguessx, eguessy) for indexo in range(len(yx)): if eguessx == yx[indexo] and eguessy == yy[indexo]: varo = True savexo = yx[indexo] saveyo = yy[indexo] yx[indexo] = 0 yy[indexo] = 0 if yx[0] + yx[1] + yx[2] + yx[3] + yx[4] == 0: thingso = False if varo: var1o = True varo = False if not var1o: if eguessy == 1: ograph1[eguessx - 1] = "x" if eguessy == 2: ograph2[eguessx - 1] = "x" if eguessy == 3: ograph3[eguessx - 1] = "x" if eguessy == 4: ograph4[eguessx - 1] = "x" if eguessy == 5: ograph5[eguessx - 1] = "x" if yx[0] + yx[1] + yx[2] + yx[3] + yx[4] == 0: thingso = False if var1o: if saveyo == 1: ograph1[savexo - 1] = "$" if saveyo == 2: ograph2[savexo - 1] = "$" if saveyo == 3: ograph3[savexo - 1] = "$" if saveyo == 4: ograph4[savexo - 1] = "$" if saveyo == 5: ograph5[savexo - 1] = "$" var1o = False varo = False if yx[0] + yx[1] + yx[2] + yx[3] + yx[4] == 0: thingso = False if not var1: print("incorrect") if guessy == 1: graph1[guessx - 1] = "x" if guessy == 2: graph2[guessx - 1] = "x" if guessy == 3: graph3[guessx - 1] = "x" if guessy == 4: graph4[guessx - 1] = "x" if guessy == 5: graph5[guessx - 1] = "x" var = False if yx[0] + yx[1] + yx[2] + yx[3] + yx[4] == 0: thingso = False if var1: print("Correct") if savey == 1: graph1[savex - 1] = "$" if savey == 2: graph2[savex - 1] = "$" if savey == 3: graph3[savex - 1] = "$" if savey == 4: graph4[savex - 1] = "$" if savey == 5: graph5[savex - 1] = "$" var1 = False var = False if yx[0] + yx[1] + yx[2] + yx[3] + yx[4] == 0: thingso = False if yx[0] + yx[1] + yx[2] + yx[3] + yx[4] == 0: thingso = False var1 = False var = False if things == False: print("you win") if thingso == False: print("you lose")

DNA to RNA Converter

This is a java script based DNA converter which converts the DNA to RNA to amino acids to proteins

2 Number, 4 Operation Calculator with JS

This code allows you to calculate the sum, difference, quotient, or product of two numbers.

DNA to RNA with HTML

This code is the same as my previous DNA to RNA code but with Firebase. When you reload the page, the previous type converted to will be saved.

Disaster page

This is designed to log people after a disaster. It uses Firebase to store its information. the bottom lists have bad CSS.

DNA to RNA with python

this program generates a random strand of DNA and converts it to RNA. After it does this, it uses a dictionary to convert the codons to amino acids

import random length = random.randint(0, 1500) bases = ["A", "T", "C", "G"] dna = [] rna = " " aa = [] sym = "" new = "" dictionary = {"A": ["GCA", "GCC", "GCG", "GCU"], "C":["UGC", "UGU"], "D":["GAC", "GAU"], "E":["GAA", "GAG"], "F":["UUC", "UUU"], "G":["GGA", "GGC", "GGG", "GGU"], "H":["CAC", "CAU"], "I":["AUA", "AUC", "AUU"], "K":["AAA", "AAG"], "L":["UUA", "UUG", "CUA", "CUC", "CUG", "CUU"], "M":["AUG"], "N":["AAC", "AAU"], "P":["CCA", "CCC", "CCG", "CCU"], "Q":["CAA", "CAG"], "R":["AGA", "AGG", "CGA", "CGC", "CGG", "CGU"], "S":["AGC", "AGU", "UCA", "UCC", "UCG", "UCU"], "T":["ACA", "ACC", "ACG", "ACU"], "V":["GUA", "GUC", "GUG", "GUU"], "W":["UGG"], "Y":["UAC", "UAU"]} for i in range(0, length, 1): dnabase = random.randint(0, 3) base = bases[dnabase] dna.append(base) for x in range(0, len(dna)): if dna[x] == "A": rna += "U" if dna[x] == "T": rna += "A" if dna[x] == "C": rna += "G" if dna[x] == "G": rna += "C" for i in range(1, len(rna), 1): if i % 3 == 0: stuff = i stuffy = i-1 stuffed = i-2 codon = rna[stuffed] + rna[stuffy] + rna[stuff] aa.append(codon) for key in dictionary: value = dictionary[key] if codon in value: new += key print(dna) print(rna) print(aa) print(new) print("the length is", length)

Guessing Game

Guess the random number the computer generates. Python code using the while loop.

Calculator

This is a calculator that has a user interface to work with like it is a calculator application. In this program, making sure the numbers were converted and joined correctly was important so that there are no errors in the operations.

1 2 ... 27