Diff
checker
Text
Text
Bilder
Dokumente
Excel
Ordner
Legal
Enterprise
Desktop-App
Preise
Einloggen
Diffchecker Desktop herunterladen
Texte vergleichen
Finde den Unterschied zwischen zwei Textdateien
Werkzeuge
Verlauf
Live-Editor
Leerzeichen ausblenden
Gleiches ausblenden
Zeilenumbruch aus
Ansicht
Zweispaltig
Einspaltig
Vergleichsgenauigkeit
Intelligent
Wort
Zeichen
Textstile
Darstellung ändern
Syntaxhervorhebung
Syntax auswählen
Ignorieren
Text umwandeln
Zur ersten Änderung
Eingabe bearbeiten
Diffchecker Desktop
Der sicherste Weg, Diffchecker zu nutzen. Hol dir die Desktop-App: Deine Diffs verlassen nie deinen Computer!
Desktop holen
Untitled diff
Erstellt
vor 7 Jahren
Diff läuft nie ab
Löschen
Exportieren
Teilen
Erklären
16 Entfernungen
Zeilen
Gesamt
Entfernt
Zeichen
Gesamt
Entfernt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
88 Zeilen
Kopieren
16 Hinzufügungen
Zeilen
Gesamt
Hinzugefügt
Zeichen
Gesamt
Hinzugefügt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
88 Zeilen
Kopieren
#version 450
#version 450
#define WIDTH 800
#define WIDTH 800
#define HEIGHT 600
#define HEIGHT 600
#define WORKGROUP_SIZE 32
#define WORKGROUP_SIZE 32
layout (local_size_x = WORKGROUP_SIZE, local_size_y = WORKGROUP_SIZE, local_size_z = 1) in;
layout (local_size_x = WORKGROUP_SIZE, local_size_y = WORKGROUP_SIZE, local_size_z = 1) in;
layout(binding = 0) readonly buffer buf1 {
layout(binding = 0) readonly buffer buf1 {
Kopieren
Kopiert
Kopieren
Kopiert
int data
[WIDTH]
[HEIGHT]
;
int data
[HEIGHT]
[WIDTH]
;
} previousBoard;
} previousBoard;
layout(binding = 1) buffer buf2 {
layout(binding = 1) buffer buf2 {
Kopieren
Kopiert
Kopieren
Kopiert
int data
[WIDTH]
[HEIGHT]
;
int data
[HEIGHT]
[WIDTH]
;
} nextBoard;
} nextBoard;
void main() {
void main() {
int x = int(gl_GlobalInvocationID.x);
int x = int(gl_GlobalInvocationID.x);
int y = int(gl_GlobalInvocationID.y);
int y = int(gl_GlobalInvocationID.y);
if(x >= WIDTH || y >= HEIGHT)
if(x >= WIDTH || y >= HEIGHT)
return;
return;
uint countNeighboors = 0;
uint countNeighboors = 0;
if (y > 0)
if (y > 0)
{
{
if (x > 0)
if (x > 0)
{
{
// x - 1 ; y - 1
// x - 1 ; y - 1
Kopieren
Kopiert
Kopieren
Kopiert
countNeighboors += previousBoard.data[
x
- 1][
y
- 1];
countNeighboors += previousBoard.data[
y
- 1][
x
- 1];
}
}
// x ; y - 1
// x ; y - 1
Kopieren
Kopiert
Kopieren
Kopiert
countNeighboors += previousBoard.data
[x]
[y - 1]
;
countNeighboors += previousBoard.data
[y - 1]
[x]
;
if(x < 799)
if(x < 799)
{
{
// x + 1 ; y - 1
// x + 1 ; y - 1
Kopieren
Kopiert
Kopieren
Kopiert
countNeighboors += previousBoard.data
[x + 1]
[y - 1]
;
countNeighboors += previousBoard.data
[y - 1]
[x + 1]
;
}
}
}
}
if (x > 0)
if (x > 0)
{
{
// x - 1 ; y
// x - 1 ; y
Kopieren
Kopiert
Kopieren
Kopiert
countNeighboors += previousBoard.data
[x - 1]
[y]
;
countNeighboors += previousBoard.data
[y]
[x - 1]
;
}
}
if(x < 799)
if(x < 799)
{
{
// x + 1 ; y
// x + 1 ; y
Kopieren
Kopiert
Kopieren
Kopiert
countNeighboors += previousBoard.data
[x + 1]
[y]
;
countNeighboors += previousBoard.data
[y]
[x + 1]
;
}
}
if (y < 599)
if (y < 599)
{
{
if (x > 0)
if (x > 0)
{
{
// x - 1 ; y + 1
// x - 1 ; y + 1
Kopieren
Kopiert
Kopieren
Kopiert
countNeighboors += previousBoard.data
[x - 1]
[y + 1]
;
countNeighboors += previousBoard.data
[y + 1]
[x - 1]
;
}
}
// x ; y + 1
// x ; y + 1
Kopieren
Kopiert
Kopieren
Kopiert
countNeighboors += previousBoard.data
[x]
[y + 1]
;
countNeighboors += previousBoard.data
[y + 1]
[x]
;
if(x < 799)
if(x < 799)
{
{
// x + 1 ; y + 1
// x + 1 ; y + 1
Kopieren
Kopiert
Kopieren
Kopiert
countNeighboors += previousBoard.data[
x
+ 1][
y
+ 1];
countNeighboors += previousBoard.data[
y
+ 1][
x
+ 1];
}
}
}
}
if(countNeighboors == 3)
if(countNeighboors == 3)
{
{
Kopieren
Kopiert
Kopieren
Kopiert
nextBoard.data[
x][y
] = 1;
nextBoard.data[
y][x
] = 1;
}
}
else if (countNeighboors == 2)
else if (countNeighboors == 2)
{
{
Kopieren
Kopiert
Kopieren
Kopiert
nextBoard.data[
x][y
] = previousBoard.data[
x][y
];
nextBoard.data[
y][x
] = previousBoard.data[
y][x
];
}
}
else
else
{
{
Kopieren
Kopiert
Kopieren
Kopiert
nextBoard.data[
x][y
] = 0;
nextBoard.data[
y][x
] = 0;
}
}
}
}
Gespeicherte Diffs
Originaltext
Datei öffnen
#version 450 #define WIDTH 800 #define HEIGHT 600 #define WORKGROUP_SIZE 32 layout (local_size_x = WORKGROUP_SIZE, local_size_y = WORKGROUP_SIZE, local_size_z = 1) in; layout(binding = 0) readonly buffer buf1 { int data[WIDTH][HEIGHT]; } previousBoard; layout(binding = 1) buffer buf2 { int data[WIDTH][HEIGHT]; } nextBoard; void main() { int x = int(gl_GlobalInvocationID.x); int y = int(gl_GlobalInvocationID.y); if(x >= WIDTH || y >= HEIGHT) return; uint countNeighboors = 0; if (y > 0) { if (x > 0) { // x - 1 ; y - 1 countNeighboors += previousBoard.data[x - 1][y - 1]; } // x ; y - 1 countNeighboors += previousBoard.data[x][y - 1]; if(x < 799) { // x + 1 ; y - 1 countNeighboors += previousBoard.data[x + 1][y - 1]; } } if (x > 0) { // x - 1 ; y countNeighboors += previousBoard.data[x - 1][y]; } if(x < 799) { // x + 1 ; y countNeighboors += previousBoard.data[x + 1][y]; } if (y < 599) { if (x > 0) { // x - 1 ; y + 1 countNeighboors += previousBoard.data[x - 1][y + 1]; } // x ; y + 1 countNeighboors += previousBoard.data[x][y + 1]; if(x < 799) { // x + 1 ; y + 1 countNeighboors += previousBoard.data[x + 1][y + 1]; } } if(countNeighboors == 3) { nextBoard.data[x][y] = 1; } else if (countNeighboors == 2) { nextBoard.data[x][y] = previousBoard.data[x][y]; } else { nextBoard.data[x][y] = 0; } }
Bearbeitung
Datei öffnen
#version 450 #define WIDTH 800 #define HEIGHT 600 #define WORKGROUP_SIZE 32 layout (local_size_x = WORKGROUP_SIZE, local_size_y = WORKGROUP_SIZE, local_size_z = 1) in; layout(binding = 0) readonly buffer buf1 { int data[HEIGHT][WIDTH]; } previousBoard; layout(binding = 1) buffer buf2 { int data[HEIGHT][WIDTH]; } nextBoard; void main() { int x = int(gl_GlobalInvocationID.x); int y = int(gl_GlobalInvocationID.y); if(x >= WIDTH || y >= HEIGHT) return; uint countNeighboors = 0; if (y > 0) { if (x > 0) { // x - 1 ; y - 1 countNeighboors += previousBoard.data[y - 1][x - 1]; } // x ; y - 1 countNeighboors += previousBoard.data[y - 1][x]; if(x < 799) { // x + 1 ; y - 1 countNeighboors += previousBoard.data[y - 1][x + 1]; } } if (x > 0) { // x - 1 ; y countNeighboors += previousBoard.data[y][x - 1]; } if(x < 799) { // x + 1 ; y countNeighboors += previousBoard.data[y][x + 1]; } if (y < 599) { if (x > 0) { // x - 1 ; y + 1 countNeighboors += previousBoard.data[y + 1][x - 1]; } // x ; y + 1 countNeighboors += previousBoard.data[y + 1][x]; if(x < 799) { // x + 1 ; y + 1 countNeighboors += previousBoard.data[y + 1][x + 1]; } } if(countNeighboors == 3) { nextBoard.data[y][x] = 1; } else if (countNeighboors == 2) { nextBoard.data[y][x] = previousBoard.data[y][x]; } else { nextBoard.data[y][x] = 0; } }
Unterschied finden