Skip to content

Instantly share code, notes, and snippets.

View MirkoPani's full-sized avatar
🦄

Mirko Pani MirkoPani

🦄
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@MirkoPani
MirkoPani / main.cpp
Created February 17, 2016 16:07
[2016-02-16] Challenge #254 [Easy] Atbash Cipher
#include <iostream>
#include <string>
int main()
{
std::string sentence;
std::cout << "Insert a sentence to translate to Cipher: " << std::endl;
std::getline(std::cin,sentence);
for (char i : sentence)
{
if (i >= 'a' && i <= 'z')
@MirkoPani
MirkoPani / cullingNumbers
Created April 2, 2015 11:36
#208 [Easy] Culling Numbers in [Java] /r/dailychallenge
public class main {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
HashSet<Integer> hs=new HashSet<Integer>();
while(in.hasNextInt())
{
hs.add(in.nextInt());
}
System.out.println(hs);
@MirkoPani
MirkoPani / GameBoy Bootstrap ROM spiegata
Last active August 29, 2016 14:59
GameBoy Bootstrap ROM Commentata
LD SP,$fffe ; $0000 Inizializza Stack- copia $fffe in SP (Stack Pointer)
XOR A ; $0003 Setta a 0 la memoria da $8000-$9FFF (VRAM) (xor tra A e se stesso=tutti 0 essendo bit uguali)
LD HL,$9fff ; $0004 Setta HL- puntatore per pulire la VRAM
Addr_0007:
LD (HL-),A ; $0007 Setta HL a 0 (essendo A tutti bit 0), decrementa HL portandolo a $9ffe
BIT 7,H ; $0008 Bit piu significante di H=$9f= 10011111 ossia 1 - zero flag del registro F viene pulito
JR NZ, Addr_0007 ; $000a jump if not zero to address 0x000C-0x0005=0x0007
questa procedura qui sopra continua in loop scrivendo 0 in $9FFE,$9FFD...fintanto che
il jump viene annullato=condizione 'not zero' vera.