Skip to content

Instantly share code, notes, and snippets.

View magmastonealex's full-sized avatar

Alex Roth magmastonealex

View GitHub Profile
<?php
$in = file_get_contents("DATA2.txt");
$data = explode("\n", $in);
foreach ($data as $instring){
$finaldata = explode(" ", $instring);
$given = intval($finaldata[0]);
Declare string to check
String with All of the vowels
String with All of the consonants
Make variable to count vowels
Make variable to count consonants
For length of string
Set achar to the current character of the strings
For length of vowels
If the current vowel equals the current character
<?php
$arr = array(3,6,7,9,10,6,7,2,1);
$count = 0;
foreach ($arr as $value) {
if($value >= 5){
$count++;
}
}
echo $count;
?>
<?php
$t1 = 120;
$t2 = 71;
$count = 2;
while($t2 < $t1){
$temp = $t2;
$t2 = $t1-$t2;
$t1 = $temp;
@magmastonealex
magmastonealex / a3q1.php
Created October 10, 2013 13:37
Assignment 3
<html>
<head>
<style>
table{
background-color: yellow;
padding: 0px;
border-spacing:0;
}
td{
border: 1px solid black;
<?php
$troutcost = 1;
$pikecost = 2;
$piccost = 3;
$total = 2;
$totalposs = 0;
for($numt=0; $numt <= floor($total/$troutcost); $numt++){
for($numpi=0; $numpi <= floor($total/$pikecost); $numpi++){
for($numpic=0; $numpic <= floor($total/$piccost); $numpic++){
<!-- saved from url=(0025)http://magmastone.net/CS/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Computer Science - Alex Roth</title>
<link href="./Computer Science - Alex Roth_files/css" rel="stylesheet" type="text/css">
<link href="./Computer Science - Alex Roth_files/index.css" rel="stylesheet" type="text/css">
<script src="./Computer Science - Alex Roth_files/jquery.min.js"></script>
<script src="./Computer Science - Alex Roth_files/index.js"></script>
<style type="text/css"></style></head>
<body style="background-color: rgb(204, 204, 204);">
<?php
$troutcost = 1;
$pikecost = 2;
$pickerelpoints = 3;
$total = 2
$tpoints = 0;
$numtrout=0;
$numpike=0;
<?php
for($y = 0; $y < 4; $y++){
for($x =0 $x < $y; $x++){
echo "*";
}
}
echo "<br>";
for($y = 2; $y > 0; $y--){
for($x =0 $x < $y; $x++){
<?php
for($x = 0; x < 5; x++){
for($y = 0; y < 6-$x; y++){
echo "*";
}
echo "<br>";
}