Skip to content

Commit d156f87

Browse files
committed
code style change of printouts
1 parent 4964fdd commit d156f87

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

python2cppconverter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def generate_completion(input_prompt, num_tokens):
6767
temperature = 0.0
6868
if SET_TEMPERATURE_NOISE:
6969
temperature += 0.1 * round(random.uniform(-1, 1), 1)
70-
print("CODEX: Let me come up with something new ...")
70+
print("__CODEX: Let me come up with something new ...")
7171
response = openai.Completion.create(engine='code-davinci-002', prompt=input_prompt, temperature=temperature,
7272
max_tokens=num_tokens, stream=STREAM, stop='===================\n',
7373
top_p=1.0, frequency_penalty=0.0, presence_penalty=0.0)
@@ -106,8 +106,7 @@ def test_cpp_compilation(cppFile):
106106

107107

108108
def iterate_for_compilable_solution(prompt, maxIterations):
109-
print('Iterating for a compilable C++ solution ...')
110-
print()
109+
print('Codex is looking for a compilable C++ solution ...')
111110
for it in range(maxIterations):
112111
response = generate_completion(prompt, num_tokens=MAX_TOKENS_DEFAULT)
113112
textResponse = get_generated_response(response)

simpleScript.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,19 @@ def add_something(x, y):
44
return z
55

66

7-
def print_something_fancy(size):
8-
for it in range(size):
7+
def print_something_fancy(n):
8+
for it in range(n):
99
string_to_print = it * "#"
1010
print(string_to_print)
1111

1212

1313
def fibonacci(n):
1414
if n < 0:
1515
print("Incorrect input")
16-
1716
elif n == 0:
1817
return 0
19-
2018
elif n == 1 or n == 2:
2119
return 1
22-
2320
else:
2421
return fibonacci(n - 1) + fibonacci(n - 2)
2522

0 commit comments

Comments
 (0)