Jump to content

What fun projects are you working on for school, work, or pleasure?

Building a command line based XML Editor, which I hope makes XML files easier and more efficient to create and edit. And I am planning on making a application which would push navigation from your PC to your android phone.

I have a utility I wrote a while ago to parse an Excel document into multiple XML files, so I wrote quite a bit of utility methods to help with the XML process. The one I use most frequently is my own personal serializer for any object (serializable or not), was pretty helpful for a few of the outdated projects I was working with that I didn't want to change too many things around with. 

 

.NET makes working with XML pretty easy, the whole System.Xml namespace has a ton of helpful methods. 

Link to comment
Share on other sites

Link to post
Share on other sites

I have a utility I wrote a while ago to parse an Excel document into multiple XML files, so I wrote quite a bit of utility methods to help with the XML process. The one I use most frequently is my own personal serializer for any object (serializable or not), was pretty helpful for a few of the outdated projects I was working with that I didn't want to change too many things around with. 

 

.NET makes working with XML pretty easy, the whole System.Xml namespace has a ton of helpful methods. 

 

Thanks for letting me know that.  :)  Though I am writing the program in C++(since I only really know C++ and Java), but is there any libraries other than MSXML that would have functions with XML files? I am worried about compatibility issues with OSes like Linux and OSX.

Link to comment
Share on other sites

Link to post
Share on other sites

Building a command line based XML Editor, which I hope makes XML files easier and more efficient to create and edit. And I am planning on making a application which would push navigation from your PC to your android phone.

Very cool!  I have only recently touched XML, but I have been trying to work on reading from text files, which I think involved XML if I so wished...

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

I'd try WordPress if you're looking to get into web stuff. It gives you the framework to use and you can mess around with it later.

 

I found Unity was fairly easy. Or if you're familiar with C# XNA is also decent to learn with (but obsolete, it was made for Xbox 360 indie devs).

Nice!  I would love to look into that.  Specifically with learning about texture mapping, so hopefully that might be a good place to start, even though you say it's obsolete.  

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

i recommend you make a mod for any game using the id tech 5 game engine. Rage i think comes to mind.

 

idk what you plan to do with your programming you aska very broad question

Link to comment
Share on other sites

Link to post
Share on other sites

i recommend you make a mod for any game using the id tech 5 game engine. Rage i think comes to mind.

 

idk what you plan to do with your programming you aska very broad question

I think that's a good idea!  That's precisely the kind of thing I would like experience with is modding..

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

I think that's a good idea!  That's precisely the kind of thing I would like experience with is modding..

 

 

i say tech 5 engine specifically because teh language involved will give a good idea on how a very powerful game engine works

 

Also modding skyrim would be good

 

in terms of easiest to hardest i would assume

 

adding items and abilities = easiest

 

adding events and scripts to AI = medium

 

adding fullblown quests and areas would be most hard

 

note i did not suggest armor mods or actual item models that would require artistic skills but all in all should be between easy and medium to get working

Link to comment
Share on other sites

Link to post
Share on other sites

i say tech 5 engine specifically because teh language involved will give a good idea on how a very powerful game engine works

 

Also modding skyrim would be good

 

in terms of easiest to hardest i would assume

 

adding items and abilities = easiest

 

adding events and scripts to AI = medium

 

adding fullblown quests and areas would be most hard

 

note i did not suggest armor mods or actual item models that would require artistic skills but all in all should be between easy and medium to get working

Cool, thanks!  This sounds like a good starting point...

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Cool, thanks!  This sounds like a good starting point...

 

 

also android games

 

get eclipse and write games with opengles and just make little games and expand as you go. develop a meaningful framework to be  the start of a game engine

Link to comment
Share on other sites

Link to post
Share on other sites

I did just write a long segment, but HIT THE F****** THUMB BACK BUTTON ON MY MOUSE WHEN I WENT TO SUBMIT  :angry: 

 

Time to start again then;

 

This project I abandoned around 4-6 months ago, as it had pretty much reached completion, I just completely forgot about it. There seems to be a few minor bugs cropped up thanks to new chrome updates and it is near completely broken in FF, don't even try IE, it just doesn't work. But on the whole, when viewed in chrome, it works (just the back cover of the front cover doesn't show when you open the book, this is a chrome update, unsure and honestly I am not interested in the project enough anymore to find a fix. I had a look for 10 minutes and gave up as it wasn't a quick fix that I could see. If anyone knows, please enlighten me. Haha.

 

http://airz.othyn.com/

 

Basically, it is a new way to view a popular thread of stories by Airz23 on reddit. It takes a JSON array of the new posts (a built-in feature of reddit is that you can quickly grab an RSS or JSON version of the thread by appending '/.rss' or '/.json' to the current reddit url, in this case it just pulls from http://www.reddit.com/r/airz23/new/.json) and parses out the relevant information, sticking that into a new array and looping that onto the page, in book form.

 

So it grabs the content, generates information pertaining to each book (array) then generates the content for each page (sub array) from the post content. In that it strips out the html entities, intelligently replaces quote indentation with enclosing quote marks, structures the page and makes sure no content flows over each page, making it look and feel like a real book. It uses a combination of regex and php's built in functions to accomplish this.

 

If you'd like a snippet of the code, I can post it here, although it is messy and probably inefficient. It's heavy and takes a while to load, that's a combination of the content being pulled and arranged along with the web server not being that great.

 

That's it, for now.  ;)

Link to comment
Share on other sites

Link to post
Share on other sites

This week I made a python program that finds a knight's tour for a chessboard of given dimensions (doesn't need to be square) and represents it graphically printing on each square the number of the move that brings the knight there.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Another one of mine, again, months ago;

 

A Sanctum 2 Random Loadout Generator, requested by one of my friends as a bit of fun. 

 

It just randomly picks from an array of the characters, weapons, etc... and displays them to the page.

 

Again, project took around 30 mins to complete, one minor bug is that you can get duplicate items returned, just requires a log of chosen numbers to be checked against, again not much interest in the project, I'll find time to fix it one day. 

 

Another thing in which would improve the usability/appearance would be to have the button launch off an AJAX call to grab the new loadout instead of just lazily refreshing the page, but again comes back to the interest part. Hehe.

Link to comment
Share on other sites

Link to post
Share on other sites

I did just write a long segment, but HIT THE F****** THUMB BACK BUTTON ON MY MOUSE WHEN I WENT TO SUBMIT  :angry: 

 

Time to start again then;

 

This project I abandoned around 4-6 months ago, as it had pretty much reached completion, I just completely forgot about it. There seems to be a few minor bugs cropped up thanks to new chrome updates and it is near completely broken in FF, don't even try IE, it just doesn't work. But on the whole, when viewed in chrome, it works (just the back cover of the front cover doesn't show when you open the book, this is a chrome update, unsure and honestly I am not interested in the project enough anymore to find a fix. I had a look for 10 minutes and gave up as it wasn't a quick fix that I could see. If anyone knows, please enlighten me. Haha.

 

http://airz.othyn.com/

 

Basically, it is a new way to view a popular thread of stories by Airz23 on reddit. It takes a JSON array of the new posts (a built-in feature of reddit is that you can quickly grab an RSS or JSON version of the thread by appending '/.rss' or '/.json' to the current reddit url, in this case it just pulls from http://www.reddit.com/r/airz23/new/.json) and parses out the relevant information, sticking that into a new array and looping that onto the page, in book form.

 

So it grabs the content, generates information pertaining to each book (array) then generates the content for each page (sub array) from the post content. In that it strips out the html entities, intelligently replaces quote indentation with enclosing quote marks, structures the page and makes sure no content flows over each page, making it look and feel like a real book. It uses a combination of regex and php's built in functions to accomplish this.

 

If you'd like a snippet of the code, I can post it here, although it is messy and probably inefficient. It's heavy and takes a while to load, that's a combination of the content being pulled and arranged along with the web server not being that great.

 

That's it, for now.  ;)

Nice!  I am not familiar with anything web based, but if you post the snippet, that is something I could perhaps cut my teeth on!  I like the idea!  Pretty interesting!

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

This week I made a python program that finds a knight's tour for a chessboard of given dimensions (doesn't need to be square) and represents it graphically printing on each square the number of the move that brings the knight there.

That sounds really cool!

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Another one of mine, again, months ago;

 

A Sanctum 2 Random Loadout Generator, requested by one of my friends as a bit of fun. 

 

It just randomly picks from an array of the characters, weapons, etc... and displays them to the page.

 

Again, project took around 30 mins to complete, one minor bug is that you can get duplicate items returned, just requires a log of chosen numbers to be checked against, again not much interest in the project, I'll find time to fix it one day. 

 

Another thing in which would improve the usability/appearance would be to have the button launch off an AJAX call to grab the new loadout instead of just lazily refreshing the page, but again comes back to the interest part. Hehe.

Very cool!  I would love to mess with something like this.  Plenty of games you could apply this to...I suppose the uitility would be that you can mess around with combinations you didn't think about.  I am thinking Fallout for some reason, even though this would probably be more appropriate for online FPS's in general

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Ok, I'll drop the code for both below, I like to heavily comment my code - helps me in future and hopefully others as well, it's a good practice to get into from the start - :

 

 

 

Airz23 Story Books:

 

<!DOCTYPE html><html lang="en"><head>	<meta charset="utf-8">	<meta http-equiv="X-UA-Compatible" content="IE=edge">	<meta name="viewport" content="width=device-width, initial-scale=1">	<meta name="description" content="Othyn Fall">	<meta name="keywords" content="Othyn - Media Production, Programming, Web Development, Gaming and Entertainment." />	<meta name="author" content="Othyn">	<link rel="shortcut icon" href="favicon.png">	<title>Airz23 Story Time</title>	<!-- Bootstrap core CSS -->	<link href="css/bootstrap.min.css" rel="stylesheet">	<!-- Custom sheet -->	<link href="css/base.css" rel="stylesheet">	<!-- Book sheets -->	<link rel="stylesheet" type="text/css" href="css/component2.css" />		<!-- The 3D Bookshelf itself isn't made by me, but is made by Mary Lou over at codrops, check it out below, amazing work! -->	<!-- http://tympanus.net/codrops/2013/01/08/3d-book-showcase/ -->	<!-- Although I have modified quite a few things to make it fit into the project, so it may not look exactly the same -->		<!-- Credit for the bookshelf design goes to: -->	<!-- http://medialoot.com/item/free-vector-shelves/ -->	<!-- I've tweaked the design slightly, mainly the width. I also used those assets to create the sign at the top, to maintain uniformity -->		<!-- The implementation (idea & design to coding & logic) was all me, with a little help from archived threads on stackexchange (to get the gist of a few things) and other forums (mainly for the regex, in which these site are awesome for testing regex: http://www.regexr.com/ and http://www.phpliveregex.com/) and the PHP function reference sheets for refreshing my memory on the syntax --></head><?php	//die();		//error_reporting(E_ALL);		function create_speech($speech) {		return $speech[0].'"<br>';	}		date_default_timezone_set("Europe/London");	$string_reddit = file_get_contents("http://www.reddit.com/user/airz23/submitted/.json");	$json = json_decode($string_reddit, true);	$feed = $json['data']['children'];	$time = time();	$time_minus_day = strtotime('-1 day', $time);	$i=0;	foreach($feed as $story){		$airz_stories[$i] = array(			'id' 		  => $story['data']['id'],			'url'		  => $story['data']['url'],			'subreddit'   => $story['data']['subreddit'],			'score'       => $story['data']['score'],			'title' 	  => (strlen($story['data']['title'])>40?substr($story['data']['title'],0,40).'...':$story['data']['title']),			'full_title'  => $story['data']['title'],			//'html_story'  => strip_tags(html_entity_decode($story['data']['selftext_html'])),			//'_html_story' => str_split(strip_tags(html_entity_decode($story['data']['selftext_html'])),350),			'submit_date' => date('d/m/Y H:s', $story['data']['created']),			'is_new'	  => ($story['data']['created']>$time_minus_day?'new-story':''),			'is_new_text' => ($story['data']['created']>$time_minus_day?'<i>NEW - </i>':''),			'increment'	  => $i		);				// Start story content		//-------------------------		$html_story = html_entity_decode($story['data']['selftext_html']);		$html_story = preg_replace("/<a [a-zA-Z]+.+<\/a>/", "", $html_story); //remove the previous / next links, and any other links		$html_story = preg_replace("/:\s/", ": "", $html_story); //To be more accurate that it is a quote, I could use a backreference, but the problem comes when there are mutliple quotes within one set of blockquote tags.		$html_story = strip_tags($html_story);		$html_story = preg_replace_callback("/ "[a-zA-Z]+.+/", 'create_speech', $html_story); //Could also use a backreference and then append the quote onto that, but ah well		$html_story = '<div class="bk-content">'.wordwrap($html_story, 300, '</div><div class="bk-content">').'</div>';		//$html_story = preg_replace( '/((?:\S*?\s){25})/', "<div class=\"bk-content\">$1</div>", $html_story);		//$html_story = preg_split("/((?:\S*?\s){25})/", $html_story, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);		//couldn't use regex thanks to it not being able to include the final wording in the string, so it would miss the tail off the strings as they didn't match the regex fed into it		$airz_stories[$i]['_html_story'] = $html_story;		//-------------------------		// End story content	-- How it works:		//	- encodes the html tags back into a useable state		//	- then, it adds quote marks for formatting to characters speech		//	- I then remove the html tags from the string as I don't need them, could have done this in the same line as the html_entity_decode but I was using the <blockquote> tags as a reference before I realised that wasn't going to work		//	- it then finds where the opening quote marks are to the characters speech and appends the closing quote mark to the string		//	- once its processed the string with the relevant formatting, I break it down into the book pages, wrapping it in the relevant div tags that the book requires to define pages		//	- then pass that to the book contents array to be displayed to the user				$i++;	}?><body>	<div class="container">		<div class="row">						<div class="col-xs-12 col-md-12 col-lg-12">								<div class="main">					<div class="sign"></div>					<div style="margin-left:40px;">						<ul id="bk-list" class="bk-list clearfix">											<?php foreach($airz_stories as $key => $val): ?>							<li>								<div class="bk-book book-1 <?=$val['is_new'];?>">									<div class="bk-front">										<div class="bk-cover">											<h2>												<span style="font-size:8pt;"><?=$val['title'];?></span>											</h2>										</div>										<div class="bk-cover-back"></div>									</div>									<div class="bk-page">										<div class="bk-content bk-content-current book-chapter-title">											<?=$val['full_title']?>											<br />											<p class="book-chapter-title-author">- Airz23, <?=$val['submit_date'];?></p>										</div>										<?=$val['_html_story'];?>									</div>									<div class="bk-back">									</div>									<div class="bk-right"></div>									<div class="bk-left">										<h2>											<span style="font-size:8pt;"><?=$val['is_new_text'];?><?=$val['title'];?></span>										</h2>									</div>									<div class="bk-top"></div>									<div class="bk-bottom"></div>								</div>							</li>							<?php endforeach; ?>													</ul>					</div>					<div class="bookshelf"></div>				</div>							</div>		</div>	</div>	<!-- Bootstrap core JavaScript	================================================== -->	<!-- Placed at the end of the document so the pages load faster -->	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>	<script src="js/bootstrap.min.js"></script>		<!-- Book JS -->	<script src="js/modernizr.custom.js"></script>	<script src="js/books2.js"></script>	<script>		$(function() {			Books.init();		});	</script></body></html> 

 

 

 

Sanctum 2 Loadout Generator:

 

<!DOCTYPE html><html lang="en"><head>	<meta charset="utf-8">	<meta http-equiv="X-UA-Compatible" content="IE=edge">	<meta name="viewport" content="width=device-width, initial-scale=1">	<meta name="description" content="Othyn Fall">	<meta name="keywords" content="Othyn - Media Production, Programming, Web Development, Gaming and Entertainment." />	<meta name="author" content="Othyn">	<link rel="shortcut icon" href="favicon.png">	<title>Othyn Fall</title>	<!-- Bootstrap core CSS -->	<link href="css/bootstrap.min.css" rel="stylesheet">	<!-- Custom sheet -->	<link href="css/base.css" rel="stylesheet">	<!-- Just for debugging purposes. Don't actually copy this line! -->	<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->	<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->	<!--[if lt IE 9]>	<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>	<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>	<![endif]--></head><?php	$CharacterList = array(		'Skye Autumn', 		'Sweet Autumn', 		'Simo', 		'Haigen Hawkins', 		'Tsygan'	);		$WeaponList = array(		'Assault Rifle',		'Rex',		'Sniper Rifle',		'Shotgun',		'Ballista',		'Voltaic Hand Cannon',		'Battle Rifle',		'Tesla Rifle',		'Sub Mini-Gun',		'Gatling Laser',		'Circle Saw',		'Nailgun',		'Drone Launcher',		'Grenade Launcher',		'Plasma Rifle',		'Smatter Band'	);		$TowerList = array(		'Cannon',		'Gatling',		'Lightning',		'AR Mine Dispenser',		'ACP',		'Kairos',		'Drone',		'Violator',		'Rocket',		'Amp Spire',		'Scatter Laser',		'Focus',		'Slowfield Dispenser',		'Range Spire',		'Makeshift Cannon',		'Rupture Mine Dispenser',		'Friendship Laser',		'Mind Control Spire',		'Anti Air',		'Orbital Strike Relay'	);		$PerkList = array(		'Hollowpoint Rounds',		'Static Discharge',		'Resilient Core',		'Unstable Core',		'Marksman',		'Hip Fire',		'Corpse Explosion',		'Phoenix',		'Rymdskor',		'Plumber Shoes',		'Overcharge',		'Against All Odds',		'Adrenaline Rush',		'Tactical Juxtapositin',		'Shocking Revelation',		'Exposure Rounds',		'Slowing Presence',		'Engineer',		'Penetrator Rounds',		'Slowing Rounds',		'Comsuming Rage',		'Core-Tower Synergy',		'Long Range Specialization',		'Synergy',		'Core Guardian',		'G-2 Companion',		'Trickster',		'Tinkerer',		'Electrical Outburst',		'Fast Hands',		'Spiked Armor',		'Explosive Exchange',		'Thor Module',		'Long Range Superiority',		'Parthian Tactics',		'Desperate Measures',		'Bloodletter',		'Collateral Damage',		'Zeus Module',		'Frightening Visage',		'Headache',		'Reinforcements',		'Best Friends Forever',		'Tech Junkie',		'Armor Shredder',		'Roboticist',		'Overkill',		'Hydra Blood',		'Steady Aim',		'Spray N Pray',		'Biological Warfare',		'Upper Class',		'Warming Up'	);				$cc = mt_rand(0, count($CharacterList));	//echo 'cc: '.$cc;	if($cc == count($CharacterList)){		$cc = $cc - 1;	}	//echo '<br>cc: '.$cc;				$pw = mt_rand(0, count($WeaponList));	//echo '<br>pw: '.$pw;	if($pw == count($WeaponList)){		$pw = $pw - 1;	}	//echo '<br>pw: '.$pw;		$sw = mt_rand(0, count($WeaponList));	//echo '<br>sw: '.$sw;	if($sw == count($WeaponList)){		$sw = $sw - 1;	}	//echo '<br>sw: '.$sw;				$tc1 = mt_rand(0, count($TowerList));	//echo '<br>tc1: '.$tc1;	if($tc1 == count($TowerList)){		$tc1 = $tc1 - 1;	}	//echo '<br>tc1: '.$tc1;		$tc2 = mt_rand(0, count($TowerList));	//echo '<br>tc2: '.$tc2;	if($tc2 == count($TowerList)){		$tc2 = $tc2 - 1;	}	//echo '<br>tc2: '.$tc2;		$tc3 = mt_rand(0, count($TowerList));	//echo '<br>tc3: '.$tc3;	if($tc3 == count($TowerList)){		$tc3 = $tc3 - 1;	}	//echo '<br>tc3: '.$tc3;		$tc4 = mt_rand(0, count($TowerList));	//echo '<br>tc4: '.$tc4;	if($tc4 == count($TowerList)){		$tc4 = $tc4 - 1;	}	//echo '<br>tc4: '.$tc4;				$pl1 = mt_rand(0, count($PerkList));	//echo '<br>pl1: '.$pl1;	if($pl1 == count($PerkList)){		$pl1 = $pl1 - 1;	}	//echo '<br>pl1: '.$pl1;		$pl2 = mt_rand(0, count($PerkList));	//echo '<br>pl2: '.$pl2;	if($pl2 == count($PerkList)){		$pl2 = $pl2 - 1;	}	//echo '<br>pl2: '.$pl2;		$pl3 = mt_rand(0, count($PerkList));	//echo '<br>pl3: '.$pl3;	if($pl3 == count($PerkList)){		$pl3 = $pl3 - 1;	}	//echo '<br>pl3: '.$pl3;				$character	= $CharacterList[$cc];	$p_weapon	= $WeaponList[$pw];	$s_weapon	= $WeaponList[$sw];	$tower_1	= $TowerList[$tc1];	$tower_2	= $TowerList[$tc2];	$tower_3	= $TowerList[$tc3];	$tower_4	= $TowerList[$tc4];	$perk_1		= $PerkList[$pl1];	$perk_2		= $PerkList[$pl2];	$perk_3		= $PerkList[$pl3];	?><body>	<div class="navbar navbar-default navbar-fixed-top" role="navigation">		<div class="container">			<div class="navbar-header">				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">					<span class="sr-only">Toggle navigation</span>					<span class="icon-bar"></span>					<span class="icon-bar"></span>					<span class="icon-bar"></span>				</button>				<a class="navbar-brand" href="http://www.othyn.com">Othyn</a>			</div>			<div class="collapse navbar-collapse">				<ul class="nav navbar-nav navbar-right">					<li><a href="http://www.othyn.com">Home</a></li>					<li><a href="#">About</a></li>					<li><a href="#">Contact</a></li>				</ul>			</div><!--/.nav-collapse -->		</div>	</div>		<br />	<br />	<br /><!-- Temporary. ... and lazyness. -->	<br />	<br />		<div class="container">		<div class="row">			<div class="col-md-1">				<!-- just for spacing -->			</div>						<div class="col-md-10">				<div class="panel panel-othyn">					<div class="panel-heading">						<h3 class="panel-title">Sanctum 2 Loadout Generator</h3>					</div>					<div class="panel-body table-responsive">						<table class="table table-striped table-othyn">							<tbody>								<tr>									<td width="20%"><strong>Character:</strong></td>									<td width="20%"><?=$character ?></td>									<td width="20%"></td>									<td width="20%"></td>									<td width="20%"></td>								</tr>								<tr>									<td width="20%"><strong>Primary Weapon:</strong></td>									<td width="20%"><?=$p_weapon ?></td>									<td width="20%"></td>									<td width="20%"></td>									<td width="20%"></td>								</tr>								<tr>									<td width="20%"><strong>Secondary Weapon:</strong></td>									<td width="20%"><?=$s_weapon ?></td>									<td width="20%"></td>									<td width="20%"></td>									<td width="20%"></td>								</tr>								<tr>									<td width="20%"><strong>Towers:</strong></td>									<td width="20%"><?=$tower_1 ?></td>									<td width="20%"><?=$tower_2 ?></td>									<td width="20%"><?=$tower_3 ?></td>									<td width="20%"><?=$tower_4 ?></td>								</tr>								<tr>									<td width="20%"><strong>Perks:</strong></td>									<td width="20%"><?=$perk_1 ?></td>									<td width="20%"><?=$perk_2 ?></td>									<td width="20%"><?=$perk_3 ?></td>									<td width="20%"></td>								</tr>							</tbody>						</table>												<p class="help-block" style="font-size:8pt; padding-top:10px; text-align:center;">Known bug / Fix in progress: Table will generate the same item in multiple feilds.</p>						<p class="help-block" style="font-size:8pt; padding-top:10px; text-align:center;">Also, should really implement an AJAX call instead of refreshing the page...</p>										</div>										<div class="panel-footer">						<button type="button" class="btn btn-othyn btn-sm hcenter" onClick="window.location.reload();">Generate Random Loadout</button>						<!-- cheap trick, but it works. It's only temporary ... right? -->					</div>				</div>			</div>						<div class="col-md-1">				<!-- just for spacing -->			</div>		</div>	</div>		<div class="footer">		<div class="container">			<a class="pull-right" href="sanctum_2_loadout.html"><img id="secret_img" src="img/secret.png" alt="ooohhhh... secret" width="25px" height="25px"/></a>		</div>	</div>	<!-- Bootstrap core JavaScript	================================================== -->	<!-- Placed at the end of the document so the pages load faster -->	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>	<script src="js/bootstrap.min.js"></script></body></html> 

 

Like I said before, these are old projects and I know, definitely, that the sanctum generator can be more efficient than it is and needs a rewrite.

 

Hope that helps!   :lol:

Link to comment
Share on other sites

Link to post
Share on other sites

Ok, I'll drop the code for both below, I like to heavily comment my code - helps me in future and hopefully others as well, it's a good practice to get into from the start - :

 

 

 

Airz23 Story Books:

 

<!DOCTYPE html><html lang="en"><head>	<meta charset="utf-8">	<meta http-equiv="X-UA-Compatible" content="IE=edge">	<meta name="viewport" content="width=device-width, initial-scale=1">	<meta name="description" content="Othyn Fall">	<meta name="keywords" content="Othyn - Media Production, Programming, Web Development, Gaming and Entertainment." />	<meta name="author" content="Othyn">	<link rel="shortcut icon" href="favicon.png">	<title>Airz23 Story Time</title>	<!-- Bootstrap core CSS -->	<link href="css/bootstrap.min.css" rel="stylesheet">	<!-- Custom sheet -->	<link href="css/base.css" rel="stylesheet">	<!-- Book sheets -->	<link rel="stylesheet" type="text/css" href="css/component2.css" />		<!-- The 3D Bookshelf itself isn't made by me, but is made by Mary Lou over at codrops, check it out below, amazing work! -->	<!-- http://tympanus.net/codrops/2013/01/08/3d-book-showcase/ -->	<!-- Although I have modified quite a few things to make it fit into the project, so it may not look exactly the same -->		<!-- Credit for the bookshelf design goes to: -->	<!-- http://medialoot.com/item/free-vector-shelves/ -->	<!-- I've tweaked the design slightly, mainly the width. I also used those assets to create the sign at the top, to maintain uniformity -->		<!-- The implementation (idea & design to coding & logic) was all me, with a little help from archived threads on stackexchange (to get the gist of a few things) and other forums (mainly for the regex, in which these site are awesome for testing regex: http://www.regexr.com/ and http://www.phpliveregex.com/) and the PHP function reference sheets for refreshing my memory on the syntax --></head><?php	//die();		//error_reporting(E_ALL);		function create_speech($speech) {		return $speech[0].'"<br>';	}		date_default_timezone_set("Europe/London");	$string_reddit = file_get_contents("http://www.reddit.com/user/airz23/submitted/.json");	$json = json_decode($string_reddit, true);	$feed = $json['data']['children'];	$time = time();	$time_minus_day = strtotime('-1 day', $time);	$i=0;	foreach($feed as $story){		$airz_stories[$i] = array(			'id' 		  => $story['data']['id'],			'url'		  => $story['data']['url'],			'subreddit'   => $story['data']['subreddit'],			'score'       => $story['data']['score'],			'title' 	  => (strlen($story['data']['title'])>40?substr($story['data']['title'],0,40).'...':$story['data']['title']),			'full_title'  => $story['data']['title'],			//'html_story'  => strip_tags(html_entity_decode($story['data']['selftext_html'])),			//'_html_story' => str_split(strip_tags(html_entity_decode($story['data']['selftext_html'])),350),			'submit_date' => date('d/m/Y H:s', $story['data']['created']),			'is_new'	  => ($story['data']['created']>$time_minus_day?'new-story':''),			'is_new_text' => ($story['data']['created']>$time_minus_day?'<i>NEW - </i>':''),			'increment'	  => $i		);				// Start story content		//-------------------------		$html_story = html_entity_decode($story['data']['selftext_html']);		$html_story = preg_replace("/<a [a-zA-Z]+.+<\/a>/", "", $html_story); //remove the previous / next links, and any other links		$html_story = preg_replace("/:\s/", ": "", $html_story); //To be more accurate that it is a quote, I could use a backreference, but the problem comes when there are mutliple quotes within one set of blockquote tags.		$html_story = strip_tags($html_story);		$html_story = preg_replace_callback("/ "[a-zA-Z]+.+/", 'create_speech', $html_story); //Could also use a backreference and then append the quote onto that, but ah well		$html_story = '<div class="bk-content">'.wordwrap($html_story, 300, '</div><div class="bk-content">').'</div>';		//$html_story = preg_replace( '/((?:\S*?\s){25})/', "<div class=\"bk-content\">$1</div>", $html_story);		//$html_story = preg_split("/((?:\S*?\s){25})/", $html_story, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);		//couldn't use regex thanks to it not being able to include the final wording in the string, so it would miss the tail off the strings as they didn't match the regex fed into it		$airz_stories[$i]['_html_story'] = $html_story;		//-------------------------		// End story content	-- How it works:		//	- encodes the html tags back into a useable state		//	- then, it adds quote marks for formatting to characters speech		//	- I then remove the html tags from the string as I don't need them, could have done this in the same line as the html_entity_decode but I was using the <blockquote> tags as a reference before I realised that wasn't going to work		//	- it then finds where the opening quote marks are to the characters speech and appends the closing quote mark to the string		//	- once its processed the string with the relevant formatting, I break it down into the book pages, wrapping it in the relevant div tags that the book requires to define pages		//	- then pass that to the book contents array to be displayed to the user				$i++;	}?><body>	<div class="container">		<div class="row">						<div class="col-xs-12 col-md-12 col-lg-12">								<div class="main">					<div class="sign"></div>					<div style="margin-left:40px;">						<ul id="bk-list" class="bk-list clearfix">											<?php foreach($airz_stories as $key => $val): ?>							<li>								<div class="bk-book book-1 <?=$val['is_new'];?>">									<div class="bk-front">										<div class="bk-cover">											<h2>												<span style="font-size:8pt;"><?=$val['title'];?></span>											</h2>										</div>										<div class="bk-cover-back"></div>									</div>									<div class="bk-page">										<div class="bk-content bk-content-current book-chapter-title">											<?=$val['full_title']?>											<br />											<p class="book-chapter-title-author">- Airz23, <?=$val['submit_date'];?></p>										</div>										<?=$val['_html_story'];?>									</div>									<div class="bk-back">									</div>									<div class="bk-right"></div>									<div class="bk-left">										<h2>											<span style="font-size:8pt;"><?=$val['is_new_text'];?><?=$val['title'];?></span>										</h2>									</div>									<div class="bk-top"></div>									<div class="bk-bottom"></div>								</div>							</li>							<?php endforeach; ?>													</ul>					</div>					<div class="bookshelf"></div>				</div>							</div>		</div>	</div>	<!-- Bootstrap core JavaScript	================================================== -->	<!-- Placed at the end of the document so the pages load faster -->	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>	<script src="js/bootstrap.min.js"></script>		<!-- Book JS -->	<script src="js/modernizr.custom.js"></script>	<script src="js/books2.js"></script>	<script>		$(function() {			Books.init();		});	</script></body></html> 

 

 

 

Sanctum 2 Loadout Generator:

 

<!DOCTYPE html><html lang="en"><head>	<meta charset="utf-8">	<meta http-equiv="X-UA-Compatible" content="IE=edge">	<meta name="viewport" content="width=device-width, initial-scale=1">	<meta name="description" content="Othyn Fall">	<meta name="keywords" content="Othyn - Media Production, Programming, Web Development, Gaming and Entertainment." />	<meta name="author" content="Othyn">	<link rel="shortcut icon" href="favicon.png">	<title>Othyn Fall</title>	<!-- Bootstrap core CSS -->	<link href="css/bootstrap.min.css" rel="stylesheet">	<!-- Custom sheet -->	<link href="css/base.css" rel="stylesheet">	<!-- Just for debugging purposes. Don't actually copy this line! -->	<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->	<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->	<!--[if lt IE 9]>	<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>	<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>	<![endif]--></head><?php	$CharacterList = array(		'Skye Autumn', 		'Sweet Autumn', 		'Simo', 		'Haigen Hawkins', 		'Tsygan'	);		$WeaponList = array(		'Assault Rifle',		'Rex',		'Sniper Rifle',		'Shotgun',		'Ballista',		'Voltaic Hand Cannon',		'Battle Rifle',		'Tesla Rifle',		'Sub Mini-Gun',		'Gatling Laser',		'Circle Saw',		'Nailgun',		'Drone Launcher',		'Grenade Launcher',		'Plasma Rifle',		'Smatter Band'	);		$TowerList = array(		'Cannon',		'Gatling',		'Lightning',		'AR Mine Dispenser',		'ACP',		'Kairos',		'Drone',		'Violator',		'Rocket',		'Amp Spire',		'Scatter Laser',		'Focus',		'Slowfield Dispenser',		'Range Spire',		'Makeshift Cannon',		'Rupture Mine Dispenser',		'Friendship Laser',		'Mind Control Spire',		'Anti Air',		'Orbital Strike Relay'	);		$PerkList = array(		'Hollowpoint Rounds',		'Static Discharge',		'Resilient Core',		'Unstable Core',		'Marksman',		'Hip Fire',		'Corpse Explosion',		'Phoenix',		'Rymdskor',		'Plumber Shoes',		'Overcharge',		'Against All Odds',		'Adrenaline Rush',		'Tactical Juxtapositin',		'Shocking Revelation',		'Exposure Rounds',		'Slowing Presence',		'Engineer',		'Penetrator Rounds',		'Slowing Rounds',		'Comsuming Rage',		'Core-Tower Synergy',		'Long Range Specialization',		'Synergy',		'Core Guardian',		'G-2 Companion',		'Trickster',		'Tinkerer',		'Electrical Outburst',		'Fast Hands',		'Spiked Armor',		'Explosive Exchange',		'Thor Module',		'Long Range Superiority',		'Parthian Tactics',		'Desperate Measures',		'Bloodletter',		'Collateral Damage',		'Zeus Module',		'Frightening Visage',		'Headache',		'Reinforcements',		'Best Friends Forever',		'Tech Junkie',		'Armor Shredder',		'Roboticist',		'Overkill',		'Hydra Blood',		'Steady Aim',		'Spray N Pray',		'Biological Warfare',		'Upper Class',		'Warming Up'	);				$cc = mt_rand(0, count($CharacterList));	//echo 'cc: '.$cc;	if($cc == count($CharacterList)){		$cc = $cc - 1;	}	//echo '<br>cc: '.$cc;				$pw = mt_rand(0, count($WeaponList));	//echo '<br>pw: '.$pw;	if($pw == count($WeaponList)){		$pw = $pw - 1;	}	//echo '<br>pw: '.$pw;		$sw = mt_rand(0, count($WeaponList));	//echo '<br>sw: '.$sw;	if($sw == count($WeaponList)){		$sw = $sw - 1;	}	//echo '<br>sw: '.$sw;				$tc1 = mt_rand(0, count($TowerList));	//echo '<br>tc1: '.$tc1;	if($tc1 == count($TowerList)){		$tc1 = $tc1 - 1;	}	//echo '<br>tc1: '.$tc1;		$tc2 = mt_rand(0, count($TowerList));	//echo '<br>tc2: '.$tc2;	if($tc2 == count($TowerList)){		$tc2 = $tc2 - 1;	}	//echo '<br>tc2: '.$tc2;		$tc3 = mt_rand(0, count($TowerList));	//echo '<br>tc3: '.$tc3;	if($tc3 == count($TowerList)){		$tc3 = $tc3 - 1;	}	//echo '<br>tc3: '.$tc3;		$tc4 = mt_rand(0, count($TowerList));	//echo '<br>tc4: '.$tc4;	if($tc4 == count($TowerList)){		$tc4 = $tc4 - 1;	}	//echo '<br>tc4: '.$tc4;				$pl1 = mt_rand(0, count($PerkList));	//echo '<br>pl1: '.$pl1;	if($pl1 == count($PerkList)){		$pl1 = $pl1 - 1;	}	//echo '<br>pl1: '.$pl1;		$pl2 = mt_rand(0, count($PerkList));	//echo '<br>pl2: '.$pl2;	if($pl2 == count($PerkList)){		$pl2 = $pl2 - 1;	}	//echo '<br>pl2: '.$pl2;		$pl3 = mt_rand(0, count($PerkList));	//echo '<br>pl3: '.$pl3;	if($pl3 == count($PerkList)){		$pl3 = $pl3 - 1;	}	//echo '<br>pl3: '.$pl3;				$character	= $CharacterList[$cc];	$p_weapon	= $WeaponList[$pw];	$s_weapon	= $WeaponList[$sw];	$tower_1	= $TowerList[$tc1];	$tower_2	= $TowerList[$tc2];	$tower_3	= $TowerList[$tc3];	$tower_4	= $TowerList[$tc4];	$perk_1		= $PerkList[$pl1];	$perk_2		= $PerkList[$pl2];	$perk_3		= $PerkList[$pl3];	?><body>	<div class="navbar navbar-default navbar-fixed-top" role="navigation">		<div class="container">			<div class="navbar-header">				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">					<span class="sr-only">Toggle navigation</span>					<span class="icon-bar"></span>					<span class="icon-bar"></span>					<span class="icon-bar"></span>				</button>				<a class="navbar-brand" href="http://www.othyn.com">Othyn</a>			</div>			<div class="collapse navbar-collapse">				<ul class="nav navbar-nav navbar-right">					<li><a href="http://www.othyn.com">Home</a></li>					<li><a href="#">About</a></li>					<li><a href="#">Contact</a></li>				</ul>			</div><!--/.nav-collapse -->		</div>	</div>		<br />	<br />	<br /><!-- Temporary. ... and lazyness. -->	<br />	<br />		<div class="container">		<div class="row">			<div class="col-md-1">				<!-- just for spacing -->			</div>						<div class="col-md-10">				<div class="panel panel-othyn">					<div class="panel-heading">						<h3 class="panel-title">Sanctum 2 Loadout Generator</h3>					</div>					<div class="panel-body table-responsive">						<table class="table table-striped table-othyn">							<tbody>								<tr>									<td width="20%"><strong>Character:</strong></td>									<td width="20%"><?=$character ?></td>									<td width="20%"></td>									<td width="20%"></td>									<td width="20%"></td>								</tr>								<tr>									<td width="20%"><strong>Primary Weapon:</strong></td>									<td width="20%"><?=$p_weapon ?></td>									<td width="20%"></td>									<td width="20%"></td>									<td width="20%"></td>								</tr>								<tr>									<td width="20%"><strong>Secondary Weapon:</strong></td>									<td width="20%"><?=$s_weapon ?></td>									<td width="20%"></td>									<td width="20%"></td>									<td width="20%"></td>								</tr>								<tr>									<td width="20%"><strong>Towers:</strong></td>									<td width="20%"><?=$tower_1 ?></td>									<td width="20%"><?=$tower_2 ?></td>									<td width="20%"><?=$tower_3 ?></td>									<td width="20%"><?=$tower_4 ?></td>								</tr>								<tr>									<td width="20%"><strong>Perks:</strong></td>									<td width="20%"><?=$perk_1 ?></td>									<td width="20%"><?=$perk_2 ?></td>									<td width="20%"><?=$perk_3 ?></td>									<td width="20%"></td>								</tr>							</tbody>						</table>												<p class="help-block" style="font-size:8pt; padding-top:10px; text-align:center;">Known bug / Fix in progress: Table will generate the same item in multiple feilds.</p>						<p class="help-block" style="font-size:8pt; padding-top:10px; text-align:center;">Also, should really implement an AJAX call instead of refreshing the page...</p>										</div>										<div class="panel-footer">						<button type="button" class="btn btn-othyn btn-sm hcenter" onClick="window.location.reload();">Generate Random Loadout</button>						<!-- cheap trick, but it works. It's only temporary ... right? -->					</div>				</div>			</div>						<div class="col-md-1">				<!-- just for spacing -->			</div>		</div>	</div>		<div class="footer">		<div class="container">			<a class="pull-right" href="sanctum_2_loadout.html"><img id="secret_img" src="img/secret.png" alt="ooohhhh... secret" width="25px" height="25px"/></a>		</div>	</div>	<!-- Bootstrap core JavaScript	================================================== -->	<!-- Placed at the end of the document so the pages load faster -->	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>	<script src="js/bootstrap.min.js"></script></body></html> 

 

Like I said before, these are old projects and I know, definitely, that the sanctum generator can be more efficient than it is and needs a rewrite.

 

Hope that helps!   :lol:

Cool, thank you! :D

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Cool, thank you! :D

 

I've also written the S2 Loadout Gen. in C (added code below), I have this already on my GitHub, gonna stick the other stuff on there too while I think about it.

 

See spoiler:

 

// Sanctum 2 random loadout generator#include <stdio.h>#include <time.h>#include <stdlib.h>int main (void){	char *CharacterList[] = { "Skye Autumn", "Sweet Autumn", "Simo", "Haigen Hawkins", "Tsygan" };		char *WeaponList[] = { "Assault Rifle", "Rex", "Sniper Rifle", "Shotgun", "Ballista", "Voltaic Hand Cannon", "Battle Rifle", "Tesla Rifle", "Sub Mini-Gun", "Gatling Laser", "Circle Saw", "Nailgun", "Drone Launcher", "Grenade Launcher", "Plasma Rifle", "Smatter Band" };		char *TowerList[] = { "Cannon", "Gatling", "Lightning", "AR Mine Dispenser", "ACP", "Kairos", "Drone", "Violator", "Rocket", "Amp Spire", "Scatter Laser", "Focus", "Slowfield Dispenser", "Range Spire", "Makeshift Cannon", "Rupture Mine Dispenser", "Friendship Laser", "Mind Control Spire", "Anti Air", "Orbital Strike Relay" };		char *PerkList[] = { "Hollowpoint Rounds", "Static Discharge", "Resilient Core", "Unstable Core", "Marksman", "Hip Fire", "Corpse Explosion", "Phoenix", "Rymdskor", "Plumber Shoes", "Overcharge", "Against All Odds", "Adrenaline Rush", "Tactical Juxtapositin", "Shocking Revelation", "Exposure Rounds", "Slowing Presence", "Engineer", "Penetrator Rounds", "Slowing Rounds", "Comsuming Rage", "Core-Tower Synergy", "Long Range Specialization", "Synergy", "Core Guardian", "G-2 Companion", "Trickster", "Tinkerer", "Electrical Outburst", "Fast Hands", "Spiked Armor", "Explosive Exchange", "Thor Module", "Long Range Superiority", "Parthian Tactics", "Desperate Measures", "Bloodletter", "Collateral Damage", "Zeus Module", "Frightening Visage", "Headache", "Reinforcements", "Best Friends Forever", "Tech Junkie", "Armor Shredder", "Roboticist", "Overkill", "Hydra Blood", "Steady Aim", "Spray N Pray", "Biological Warfare", "Upper Class", "Warming Up" };		srand(time(NULL));		int index_Character = rand() % 5;	int index_Weapon1 	= rand() % 16;	int index_Weapon2 	= rand() % 16;	int index_Tower1 	= rand() % 20;	int index_Tower2 	= rand() % 20;	int index_Tower3 	= rand() % 20;	int index_Tower4 	= rand() % 20;	int index_Perk1 	= rand() % 53;	int index_Perk2 	= rand() % 53;	int index_Perk3 	= rand() % 53;	int index_Perk4		= rand() % 53;	printf("Character: %s\n", CharacterList[index_Character]);	printf("Primary Weapon: %s\n", WeaponList[index_Weapon1]);	printf("Secondary Weapon: %s\n", WeaponList[index_Weapon2]);	printf("Towers: %s", TowerList[index_Tower1]);	printf(", %s", TowerList[index_Tower2]);	printf(", %s", TowerList[index_Tower3]);	printf(", %s\n", TowerList[index_Tower4]);	printf("Perks: %s", PerkList[index_Perk1]);	printf(", %s", PerkList[index_Perk2]);	printf(", %s\n", PerkList[index_Perk3]);	return 0;}

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×