malteklaes's picture
upload whole little cpp dataset
b263752 verified
raw
history blame
3.98 kB
{"repo": "ownRepo", "path": "cppExample.cpp", "func_name": "#include<iostream>", "original_string": "#include<iostream>", "code_tokens": ["#include<iostream>"], "docstring_tokens": [], "sha": "random_sha", "url": "noURL", "partition": "test"}
{"repo": "ownRepo", "path": "cppExample.cpp", "func_name": "NumberGame()", "original_string": "NumberGame() {\n srand(time(0));\n secretNumber = rand() % 11;\n }", "code_tokens": ["NumberGame", "(", ")", "{", "srand", "(", "time", "(", "0", ")", ")", ";", "secretNumber", "=", "rand", "(", ")", "%", "11", ";", "}"], "docstring_tokens": [], "sha": "random_sha", "url": "noURL", "partition": "test"}
{"repo": "ownRepo", "path": "cppExample.cpp", "func_name": "guessNumber()", "original_string": "int guessNumber() {\n int guess;\n cout << \"Rate eine Zahl zwischen 0 und 10: \";\n cin >> guess;\n return guess;\n }", "code_tokens": ["int", "guessNumber", "(", ")", "{", "int", "guess", ";", "cout", "<<", "\"Rate eine Zahl zwischen 0 und 10: \"", ";", "cin", ">>", "guess", ";", "return", "guess", ";", "}"], "docstring_tokens": [], "sha": "random_sha", "url": "noURL", "partition": "test"}
{"repo": "ownRepo", "path": "cppExample.cpp", "func_name": "checkGuess(int guess)", "original_string": "bool checkGuess(int guess) {\n if (guess == secretNumber) {\n cout << \"Glückwunsch! Du hast die richtige Zahl erraten.\" << endl;\n return true;\n } else if (guess < secretNumber) {\n cout << \"Die gesuchte Zahl ist größer als deine Eingabe.\" << endl;\n } else {\n cout << \"Die gesuchte Zahl ist kleiner als deine Eingabe.\" << endl;\n }\n return false;\n }", "code_tokens": ["bool", "checkGuess", "(", "int", "guess", ")", "{", "if", "(", "guess", "==", "secretNumber", ")", "{", "cout", "<<", "\"Glückwunsch! Du hast die richtige Zahl erraten.\"", "<<", "endl", ";", "return", "true", ";", "}", "else", "if", "(", "guess", "<", "secretNumber", ")", "{", "cout", "<<", "\"Die gesuchte Zahl ist größer als deine Eingabe.\"", "<<", "endl", ";", "}", "else", "{", "cout", "<<", "\"Die gesuchte Zahl ist kleiner als deine Eingabe.\"", "<<", "endl", ";", "}", "return", "false", ";", "}"], "docstring_tokens": [], "sha": "random_sha", "url": "noURL", "partition": "test"}
{"repo": "ownRepo", "path": "cppExample.cpp", "func_name": "startGame()", "original_string": "void startGame() {\n int attempts = 0;\n bool correctGuess = false; \n cout << \"Willkommen beim Zahlenspiel!\" << endl; \n while (!correctGuess && attempts < 3) {\n int guess = guessNumber();\n correctGuess = checkGuess(guess);\n attempts++;\n }\n if (!correctGuess) {\n cout << \"Du hast alle Versuche aufgebraucht. Die gesuchte Zahl war: \" << secretNumber << endl;\n }\n }", "code_tokens": ["void", "startGame", "(", ")", "{", "int", "attempts", "=", "0", ";", "bool", "correctGuess", "=", "false", ";", "cout", "<<", "\"Willkommen beim Zahlenspiel!\"", "<<", "endl", ";", "while", "(", "!", "correctGuess", "&&", "attempts", "<", "3", ")", "{", "int", "guess", "=", "guessNumber", "(", ")", ";", "correctGuess", "=", "checkGuess", "(", "guess", ")", ";", "attempts", "+", "+", ";", "}", "if", "(", "!", "correctGuess", ")", "{", "cout", "<<", "\"Du hast alle Versuche aufgebraucht. Die gesuchte Zahl war: \"", "<<", "secretNumber", "<<", "endl", ";", "}", "}"], "docstring_tokens": [], "sha": "random_sha", "url": "noURL", "partition": "test"}
{"repo": "ownRepo", "path": "cppExample.cpp", "func_name": "main()", "original_string": "int main() {\n NumberGame game;\n game.startGame();\n return 0;\n}", "code_tokens": ["int", "main", "(", ")", "{", "NumberGame", "game", ";", "game", ".", "startGame", "(", ")", ";", "return", "0", ";", "}"], "docstring_tokens": [], "sha": "random_sha", "url": "noURL", "partition": "test"}