Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "test2"
-
This is how my prof uses braces:
If () {
test;
} else {
test2;
}
He uses it as an example of how to use line breaks properly.19 -
I like C++, but it is seriously easy to do fucked up things:
class Test{
public:
Test(){};
};
Test test;
Test* test2 = nullptr;
Test& test3 = *test2;
Test* test4 = (Test*)0x12345;
Test& test5 = *test4;
Test* test6;
Test& test7 = *test6;
No warnings at all. I wonder if there is a flag for this kind of stupidity. Here's your sign...11 -
I never understood why there are screenshots of commits being like test, test2, does it work now? or WORK YOU SHIT..
..until i tried to gitignore stuff a bit more specific while gitkeeping folders and deploying shit relying on CORS.😂2 -
My instructor:
start
Declarations
num test1
num test2
num test2
num average
output "Enter score for test 1
input test1
output "Enter score for test 2 "
input test2
output "Enter score for test 3 "
input test3
average = test1 + test2 + test3 / 3
output "Average is ", answer
end
Me:
print("Average is "+str((int(raw_input("Enter score for Test 1\nInt> "))+int(raw_input("Enter score for Test 2\nInt> "))+int(raw_input("Enter score for Test 3\nInt> ")))/3))5 -
Hey Devrant fam!, well i'm basically trying to see if i can change up this A* algo we need to implement for an assessment, and from what i know basically most people have copy and pasted it, but not me!, so there is this one called Easy A* (star) Pathfinding By Nicholas Swift and my goal is such that i would like to make it input friendly!, here is the code in my main function
def main():
start1,start2 = input('Enter co-ordinates').split(',')
end1,end2 = input('Enter co-ordinates').split(',')
drive_mount()
open_map()
# test1 = (start1, start2)
# test2 = (end1, end2)
start = (start1, start2)
end = (end1, end2)
print(f'start co-ordinates:{start} \n end co-ordinates:{end}')
our_path = astar(our_maze, start, end)
print(f'starting co-ordinates:{start} \n ending co-ordinates:{end} \n Your shortest-path:{our_path}')
if __name__ == '__main__':
main()
however i am then greeted by this error, on line 62 specifically it says "TypeError: must be str, not int" and my original thought was to put str() around all of them, but that does not seem to work :-) any advice? thank you!3