Skip to content

Instantly share code, notes, and snippets.

@51enra
51enra / gist:2a071447885757d93282a42fbd60dafc
Created November 4, 2019 14:53
terminal history wild murder mystery ac
1 ls
2 cd mystery
3 ls
4 nano crime*
5 cd ..
6 nano hint1
7 nano hint2
8 nano hint1
9 nano hint3
10 head -n 20 hint4
@51enra
51enra / gist:5e5111b95c98898d7c7ea37bdc846f46
Created November 8, 2019 15:33
Wild Quest Structure of an HTML page
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="UTF-8" />
<title>Find the Precious!</title>
<!-- Styles -->
<!--
@51enra
51enra / gist:a594d22c899d8787a6489b187e05014f
Created November 8, 2019 16:21
HTML Structure Sauron
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="UTF-8" />
<title>Find the Precious!</title>
<!-- Styles -->
<!--
<div class="picture">
<img src="http://images.innoveduc.fr/integration_gandalf.png">
<div class="cover">
<div class="reward">
Reward <span class="amount">1000</span><br> golden coins
</div>
<div class="name">Gandalf</div>
</div>
</div>
<!DOCTYPE html
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
class Senpai {
public static void main(String[] args) {
// display Notice me Senpai in the terminal
System.out.println("Notice me Senpai");
}
}
@51enra
51enra / CandyCount.java
Created November 18, 2019 09:06
Java Quest 2
class CandyCount {
/*
Translate the following instructions in compilable Java code:
real money ← 12.4;
real price ← 1.2
candies integer ← 0
If money > 0 AND price > 0
As long as (money - price) >= 0
candies ← candies + 1
@51enra
51enra / IndianaJones.java
Created November 18, 2019 12:12
Quest 3 Java Variables
class IndianaJones {
public static void main(String[] args) {
String movieName = "Indiana Jones and the last crusade";
boolean seenMovie = false;
int releaseYear = 1989;
float movieRating = 8.2f;
String seenText;
if (seenMovie == true) {seenText = "Ja";} else {seenText = "Nein";};
System.out.println("Name des Films: " + movieName);
@51enra
51enra / Movies.java
Created November 18, 2019 13:15
Quest 4: Arrays and Loops
class Movies {
public static void main(String[] args) {
String[] movieNames = { "Raiders of the Lost Ark", "Indiana Jones and the Temple of Doom",
"Indiana Jones and the Last Crusade" };
String[][] movieMainActors = new String[][] { { "Harrison Ford", "Karen Allen", "Paul Freeman" },
{ "Harrison Ford", "Kate Capshaw", "Ke Huy Quan" },
{ "Harrison Ford", "Sean Connery", "Denholm Elliot" } };
String actorString;
for (int i = 0; i < movieNames.length; i++) {
@51enra
51enra / Decipherer.java
Created November 19, 2019 13:34
Quest 5: Decipher secret messages
public class Decipherer {
public static String decrypt(String encryptedText) {
final int STARTINDEX = 5;
int codeLength = encryptedText.length()/2;
encryptedText = encryptedText.substring(STARTINDEX, STARTINDEX + codeLength).replace("@#?", " ");
// convert String to character array