fork download
  1. using System;
  2. using System.IO;
  3.  
  4. class FolderLauncher
  5. {
  6. static void Main()
  7. {
  8. Console.WriteLine("===== HL2 Lite Folder Launcher =====\n");
  9.  
  10. // Ask for the HL2 folder
  11. Console.Write("Enter the path to your HL2 folder (where hl2 + platform are): ");
  12. string hl2Folder = Console.ReadLine();
  13.  
  14. if (!Directory.Exists(hl2Folder))
  15. {
  16. Console.WriteLine("Folder not found! Make sure the path is correct.");
  17. return;
  18. }
  19.  
  20. Console.WriteLine("Folder found: " + hl2Folder);
  21.  
  22. // Optional: list contents for confirmation
  23. Console.WriteLine("Contents:");
  24. foreach (var f in Directory.GetFiles(hl2Folder))
  25. {
  26. Console.WriteLine(" - " + Path.GetFileName(f));
  27. }
  28.  
  29. foreach (var d in Directory.GetDirectories(hl2Folder))
  30. {
  31. Console.WriteLine(" + " + Path.GetFileName(d));
  32. }
  33.  
  34. Console.WriteLine("\nReady to launch the APK or point your mobile setup here manually.");
  35. Console.WriteLine("Press Enter to finish...");
  36. Console.ReadLine();
  37. }
  38. }
Success #stdin #stdout 0.04s 28620KB
stdin
/*  Berechnung des Hamming-Abstandes zwischen zwei 128-Bit Werten in 	*/
/*	einer Textdatei. 													*/
/*  Die Werte müssen auf einer separaten Zeile gespeichert sein			*/
/* 																		*/
/*	Erstellt: 17.5.2010													*/
/*  Autor: Thomas Scheffler												*/

#include <stdio.h>
#include <stdlib.h>

#define ARRAY_SIZE 32

unsigned Hamdist(unsigned x, unsigned y)
{
  unsigned dist = 0, val = x ^ y;
 
  // Count the number of set bits
  while(val)
  {
    ++dist; 
    val &= val - 1;
  }
 
  return dist;
}



int main (void)
{
	char hex;
	int i;
	int a[ARRAY_SIZE];
	int b[ARRAY_SIZE];
	int hamDist = 0;
	FILE* fp;
	
	//Arrays mit 0 initialisieren
	for (i = 0; i < ARRAY_SIZE; ++i)
	{
  		a[i] = 0;
  		b[i] = 0;
	}

	
	fp = fopen("hex.txt","r");
	if (fp == NULL) 
	{
		printf("Die Datei hex.txt wurde nicht gefunden!");
		exit(EXIT_FAILURE);
	}

	i=0;
	printf("1.Zeile einlesen.\n");

 	while((hex=fgetc(fp))!='\n' && hex != EOF)
    {
        a[i]=strtol(&hex,0,16);
		i++;
    }
	i=0;
	printf("2.Zeile einlesen.\n");

 	while((hex=fgetc(fp))!='\n' && hex != EOF)
    {
    	b[i]=strtol(&hex,0,16);
        i++;
    }
	fclose(fp);

	printf("Hamming-Abweichung pro Nibble:\n");
	for (i = 0; i < ARRAY_SIZE; ++i)
	{
		printf ("%i\t%i\t%i\n",a[i],b[i],Hamdist(a[i],b[i]));
		hamDist += Hamdist(a[i],b[i]);
	}
	printf ("\nHamming-Abweichung der Hash-Werte:%d\n",hamDist);
}

stdout
===== HL2 Lite Folder Launcher =====

Enter the path to your HL2 folder (where hl2 + platform are): Folder not found! Make sure the path is correct.