This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gpt4; | |
public class Sudoku { | |
private int[][] board; | |
public static final int EMPTY = 0; // empty cell | |
public static final int SIZE = 9; // size of our Sudoku grids | |
public Sudoku(int[][] board) { | |
this.board = new int[SIZE][SIZE]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Random; | |
import java.util.Scanner; | |
public class ReplSweeper { | |
public static class SimpleMinesweeper { | |
private enum CellStatus { | |
EMPTY, BOMB | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Random; | |
import java.util.Scanner; | |
public class ReplSweeper { | |
public static class SimpleMinesweeper { | |
private enum CellStatus { | |
EMPTY, BOMB, MARKED | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, jsonify | |
from pymongo import MongoClient | |
app = Flask(__name__) | |
client = MongoClient("mongodb://localhost:27017") | |
db = client.hashmap_db | |
hashmap = db.hashmap | |
@app.route('/<key>', methods=['GET']) | |
def get_value(key): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.mongodb.client.MongoClients; | |
import com.mongodb.client.MongoClient; | |
import com.mongodb.client.MongoDatabase; | |
import com.mongodb.client.MongoCollection; | |
import com.mongodb.client.model.UpdateOptions; | |
import com.mongodb.client.result.DeleteResult; | |
import org.bson.Document; | |
import static com.mongodb.client.model.Filters.eq; | |
import com.google.gson.Gson; | |
import static spark.Spark.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, jsonify | |
from pymongo import MongoClient | |
app = Flask(__name__) | |
client = MongoClient("mongodb://localhost:27017") | |
db = client.hashmap_db | |
hashmap = db.hashmap | |
@app.route('/<key>', methods=['GET']) | |
def get_value(key): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fun; | |
public class SubsetsGenerator { | |
public static void main(String[] args) { | |
String input = "cat"; | |
for (int i = 0; i <= input.length(); i++) { | |
generateCombinations(input, "", 0, i); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package superprof; | |
public class SudokuChecker { | |
public static void main(String[] args) { | |
// Ein Beispiel-Sudoku-Raster | |
int[][][] sudoku = { | |
{ | |
{5, 3, 4}, | |
{6, 7, 2}, | |
{1, 9, 8} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package superprof; | |
public class ReadCode { | |
public static int findSmallest1(int a, int b, int c, int d, int e, int f) { | |
int smallest = a; | |
if (b < smallest) { | |
smallest = b; | |
} | |
if (c < smallest) { | |
smallest = c; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package superprof; | |
public class SchleifenBeispiel { | |
public static void main(String[] args) { | |
// Schleife 1: Code im Körper der Schleife | |
for (int i = 0; i < 5; ) { | |
aktion(i); | |
i++; | |
} |