So I have writen a program that takes a linkedlist and shuffles it randomly using mergesort algorithm. The problam I'm having now is that the original list loses elements after the shuffle, and after som checking with some outputs it seems that it always one of the extra lists who have elements still left inside them. This is an assignment and here is the task: >Assume you have as input ia singly-linked list containing N >items (an instance of a LinkedList class in Java). You should rearrange the items in the >LinkedList uniformly at random. Your algorithm should consume a …

Member Avatar
Member Avatar
+0 forum 2

Hi, I need to make a program that can count and solve basic math problems (addition, subtraction) with natural integers using strings. I'm not aloved to use parseInt so thats basicly where my world started to fall apart... Would realy appreciate if someone could help me with this. The code I have been given import java.util.*; //Scanner import static java.lang.System.out; public class OperationerMedNaturligaHeltalGivnaSomTeckenstranger { public static void main(String[] args) { out.println ("OPERATIONS WITH NATURAL INTEGES GIVEN " + "AS CHARACTER STRINGS\n"); // input the natural integers Scanner in = new Scanner (System.in); out.println ("two natural integers"); String tal1 = in.next(); …

Member Avatar
Member Avatar
+0 forum 10

Hey guys, I'm trying to learn how to use classes and work with seperate files, and I been reading about it and now I tryed making a little short "Hello World" thingy but I don't really understand the self. things, I thought I did but it's not working so I guess I diden't Heres the code anyways: HelloWorld.py class HelloWorld : def __init__(self): print("Hi") def Talk(self ,name): self.nameA = name print("Hello",self.nameA) Main.py import HelloWorld HelloWorld.HelloWorld.Talk("Kevin") I get the error: Traceback (most recent call last): File "D:\PygameSpel\Test med klasser\Main.py", line 3, in <module> HelloWorld.HelloWorld.Talk("Kevin") TypeError: Talk() takes exactly 2 arguments (1 …

Member Avatar
Member Avatar
+0 forum 6

I have a qucik question for you guys. Is there a way to change the taskbar icon? Im done with my game and im gonna show it in class on tuesday 14 and I just thought it would be cool to have an icon that represents the game and not just the standard code bit. I tried pygame.display.set_icon(icon) but that only changed the window icon in the taskbar its still the same onld standard one.

Member Avatar
+0 forum 0

I have a serious problem with my game right now, after each kill I get the game starts lagging more and more. I thought it was because he was drawing the same thing twice and stuff and went trough some functions that was useless. But I cleaned it up as far as I can see anyways but it dident help. So now I turn to you guys, please help me, I really want to have enemies and not just one boss and I know that having one mayor file with code makes it a bit more difficoult then it would …

Member Avatar
Member Avatar
+0 forum 2

Okey so I need help with how to make a health bar that starts out full with green color but then when I lose hp it get's smaller and smaller. I have now that my hp is 100, and then when I get hit by a bullet from the boss it hurts me 25hp per hit, so need to make a health bar that looses 25 hp everytime I get hit by a bullet.

Member Avatar
Member Avatar
+0 forum 2

Im making a 2D platformer-ish shooter its really simple and not much effort put in it, it is my first game Im making in python and its for a school project and needs to be finnised really soon. Everything is working just fine but Im having problem with some collision detection with my shoots, I don't know how to make it. So would really appreciate any help I could get. Feel free to tell me if anything is wrong or could be better and use this code for your own learnings. And I know its a bit messy but I …

Member Avatar
Member Avatar
+0 forum 11

Im doing this game for school and it's supposed to be finished real soon and then of course al the problems start coming up, the game now crashes, sometimes after a few seconds and sometimes directly on start. Don't really know why, a thought is that its doing to much at the same time, or doing something it doesent need to do. The code is verry badly done, should use classes and functions but I have really goten in to that since im really new to this (first game im doing on my own). So please, if anyone could help …

Member Avatar
Member Avatar
+0 forum 9

The End.