Cyber_Spectre
Content Type
Profiles
Articles
Updates
Projects
Twitch
Website Bugs/Suggestions
Guides
Newsletters
About GFL
Knowledge Base
Expenses/Hardware
Server Comparisons
Routing
Form Bugs
Community Representative Applications
Development Request
Forums
Events
Posts posted by Cyber_Spectre
-
-
@Joshy Thanks for the post man, I did not know that. I'll look more into this, but I try and use switch statements when I can, but if it's required or needed.
-
##Crazy.py ####### #Purpose: Count to the number 10 import sys import time def nummy(numbers): #@ return void #Take the binary amount and convert that into decimal -> charcters -> decimalOfCharacter -> hex of ASCII #Convert Hex back into decimal to print #Create an array to store information about our numbers nums = [] # Create this array to show ASCII Chars chars = [] #convert decimal into ASCII chars decimal = int(numbers,2) #Loop from 1 -> n + 1 ie 1-10 for c in range(1, decimal+1): # Have to append to an array to actually show this chars.append(str(chr(c))) #Print the cool ASCII sys.stdout.write("ASCII Chars:" + str(chars) + "\n") # from 1 to (n + 1) convert this from decimal to char to decimal to hex for i in range(1, decimal+1): nums.append(hex(ord(chr(i)))) #Print the final outcome of HEX print("HEX: " + str(nums) + "\n") #Use a 'with' statement, because I sometimes forget to close file # with open("readthis.txt", "w") as f: for i in nums: f.write(i + '\n') #Clear the array to allow for 'new' data #Not really...it's the same crap lol nums.clear() #Make it seem the program is doing something important sys.stdout.write("Doing some important ST0xFF.." + "\n") time.sleep(2) #Open our file and read it as a var of 'f'. #Read every single line and split them up, not have i.e. 0x\0x1\0x2 etc. with open("readthis.txt", "r") as f: x = f.read().splitlines() #Append this to our 'cleared' array nums for i in x: nums.append(i) #Loop through the nums array and convert all of the hex to decimal and show to the user for i in nums: sys.stdout.write(str(int(i,0)) + " " ) #main method def main(): #Give the option to put in however many numbers you want userNum = int(input("Enter number: ")) #call the function nummy and plug in numbers converted to binary sys.stdout.write("Inserting: BINARY -> " + str(bin(userNum)) + "\n") nummy(bin(userNum)) main()

Allowed the user enter an arbitrary amount of numbers to the program:
Thought this was a great idea @_Rocket_! Thanks. Can't wait to see what others put here.
This is no way the most complicated way. I may change it
*If someone just does straight up assembly I would be amazed.
*
#Also I saw no reason to check for non-positive numbers, try it out ^#
-

I've been messing around with sprites and animations in SFML. I tried to animate the tux penguin from Linux and came out with this. In fact, I believe I might make this the player. I mean, why not? What do you all think?
-
Thank you both for sharing your coding styles and making this thread very interesting. Thanks for the "godbolt" website, I'll be using this more often. A neat fact I learned is that switch statements are faster than nested if-else-if statements, here's the link to the original thread: https://stackoverflow.com/questions/2158759/case-vs-if-else-if-which-is-more-efficient
Results:
http://www.blackwasp.co.uk/SpeedTestIfElseSwitch.aspx
I've been good man, how you have been? I'll be on soon!
-
This is very interesting, I haven't seen a C++ programmer write like this. I might test this out? Have you noticed any performance differences with writing your code directly in header files, compared to their source files? Overall, every programmer writes differently. In regards to your game what is it about? And Steam? I admire you for doing this. Good luck on your goal, I'll be cheering you. Furthermore, thanks for sharing your coding style and a little bit of your game. If you ever need a beta tester, I would not mind testing it out.
-
No problem.
Here's the link to it on my github: https://github.com/lajolico/C-Projects/tree/master/Game02
-
This is a simple game, wanna play? Then download it here:
https://drive.google.com/file/d/117Kd71IbPZCSBTxZHycjkq3K7qxR9Mwn/view?usp=sharing
It was created using SFML (https://www.sfml-dev.org/) and C++.
Further down the road I will be making more games, much more complex. Now that this has become a new hobby of mine. Enjoy!
*If the download link doesn't work let me know.*
-
Just from "sf::" I know your using SFML. In fact I am currently making a game in C++ with this library, for Anti-Cheat research. When you finish your game, I would like to play it. Have fun in your coding adventures.
-
Congratulations!
-
It's been awhile, however, I have returned. Who am I? Good question. Goal: Be more active.
-
Can't wait.

Simple C++ Game
in Projects
Posted
@Joshy Thanks man! I'll be sure to share and discuss this with my CS professor.