Jump to content

tombguy5

Community Member
  • Posts

    216
  • Joined

  • Last visited

  • Donations

    0.00 GBP 

Posts posted by tombguy5

  1. Hey there Ahoyworld community!

     

    I've been working a Bubble Sort Algorithm for my grade 12 IT class using Java.

     

    I have it working properly.

     

    However, if I have values like this: 2, 5, 3, 4, 1

    the program will sort it as: 1, 2, 3, 4, 5

     

     

    But, for any values used like this: 111, 90, 12, 555, 3

    the program will sort it as: 111, 12, 3, 555, 90

     

     

    I have been trying to fix this for hours to no avail, does anyone have any idea?

    Here is the WHOLE code:

     

    Also, please let me know how I did everything as it is.

     

    I'm sure the error is of something that is extremely simple that I do not even see it!

     

    Note: The program is 60 lines long (the challenge for the class is to make it as short as possible for efficiency.)

     

     

    /**
     * === Bubble Sort Program ===
     * @author Ryan Berezon (528849)
     */
     
    package bubblesort_v2;
     
    import java.util.Scanner;
     
    public class Bubblesort_v2 {
        
        public static void main(String[] args) throws InterruptedException
        {
        int j;
            Scanner in = new Scanner(System.in);
            
            //finding the length of the Array value
            System.out.print("How many values? - Input in numbers: ");
            int totalvalue = Integer.parseInt(in.nextLine());
            String[] value = new String [totalvalue];
     
            //allows user to input student names
            int y = 1;
            for(j = 0; j < value.length;j++) 
            {
                System.out.print(y + ") Name your values: ");
                value[j] = in.nextLine();
                y += 1;
            }
            
            
            System.out.println("\n"+"Unsorted List:");
            for (String element:value)
            {   
                
                System.out.println(element);
            }
            
            Thread.sleep(1500);
            bubble_srt(value,value.length);
            System.out.print("\n"+"Sorted List:\n");
                
                for(j = 0; j < value.length; j++)
                    
                    System.out.print(value[j]+"  "); 
                    System.out.println();
                    System.out.println("\n" + "PAUSED");
        }
        
        public static void bubble_srt(String[] a, int n)
        {
        int j, i =0;
          String t;
            for(j = 0; j < n; j++)
            {
                for(i = 1; i < (n-j); i++)
                {
                    if(a[i-1].compareTo(a)>0) 
                    {
                        t = a[i-1];
                        a[i-1]=a;
                        a=t;
                    }
                }
            }
        }
     }

     

     

    Please help! Also, feedback to possibly improve the efficiency of the program would be great!

  2. As far as I know, there is a bug regarding to the greyhawk spawn because of how BIS coded the greyhawk and the way it functions.

     

    I don't have very much details about it but I'm sure there will be more people that will help fill in the gaps.

  3. So, I want to make the trigger repeat, its got repeatedly on. And as you know, Triggers have a trigger zone that will activate once a condition is met (player entering the trigger area).

    Now, for this mission I'm making, You will NOT leave the zone, so the condition is ALWAYS met and until it's not met, it will not reactivate.

    I'm just wondering if there's a way to 'trick' the trigger to restart when you execute the radio command (0-0-1). Because I'm trying to create a Strategic Map that can be called at will but because of radio commands never deactivate when its called... I want a way to deactivate it without deleting the trigger and thus giving me the option to use strategic map again.

  4. Hello y'all!

     

    I've come across an issue... As the title says, I just cant get Triggers to repeat even with Repeatedly on.

     

    Allow me to go more in-depth, I have a trigger set on repeatedly, it works when you leave the trigger zone and go back in. I don't want that to be the case, I want it to repeat even when the same unit that activated it is still in the trigger zone without leaving. I got the trigger set on Radio Command, but I still have to leave the trigger zone and go back in to call it again.

    Anyone have ideas on what I can possibly do? I've searched for hours all over and still haven't found a solution for the situation I am in.

  5. Hey there,

    I had posted my mission on Bistudio Forums (which is also now on armaholic :D)

    and I noticed that we don't have a Group in Bistudio. Do you guys think we should have one? It could potentially open up a wider array of players that would be mature I'd say because you would need an account to apply and the account making process in Bistudio is a pain so there would be less immature kiddies and more mature players on the forums.

    Making a group would also 'advertise' our existance (not saying we dont get enough players with I&A now) but make us more popular in the mature community since Bistudio is also heavily administrated.

     

    What do you guys think?

  6. Hey there! I think you're the only other Canadian other than me! eh?

     

    Welcome to the community! I'm guessing your favourite thing to do in a war is to blow stuff up :D

     

    See you on the battlefield!

  7. FIXED!

     

    I finally found the solution! How you properly implement Radio Sounds in the description.ext is like this:

     

     

    class CfgRadio
    {
    sounds[] = {brchat1, brchat2, brchat3, ctdown1, ctdownre, rsdchat1};
     
    // Definition for each Radio sound
    //==================================================================
     
    //Briefing Chat Section
     
    class brchat1
    {
    name = brchat1;
    sound[] = {"\clips\briefingchat\briefingchat1.ogg", db-0.4, 1.0};
    title = Papa Bear, This is Argonautae, mission is a go.;
    };
     
    class brchat2
    {
    name = brchat2;
    sound[] = {"\clips\briefingchat\briefingchat2.ogg", db-0.4, 1.0};
    title = Roger that Argonautae, just a word of warning... Be sure to destroy the communications tower before you destory the radar.;
    };
     
    class brchat3
    {
    name = brchat3;
    sound[] = {"\clips\briefingchat\briefingchat3.ogg", db-0.4, 1.0};
    title = Copy that, Destroy the Communications Tower before destroying the radar. Argonautae, Out.;
    };
     
    //==================================================================
     
    //Communications Tower is Down Section
     
    class ctdown1
    {
    name = ctdown1;
    sound[] = {"\clips\ctdown\ctdown1.ogg", db-0.4, 1.0};
    title = Papa Bear, this is Argonautae. The Communications tower is down, I repeat, Communications Tower is down. Over.;
    };
     
    class ctdownre
    name = ctdownre;
    sound[] = {"\clips\ctdown\ctdownre.ogg", db-0.4, 1.0};
    title = Roger that Argonautae. Continue with your mission. Papa Bear, Out;
    };
     
    //==================================================================
     
    //Radar Station Destroyed Section
     
    class rsdchat1
    {
    name = rsdchat1;
    sound[] = {"\clips\rsd\rsdchat1.ogg", db-0.4, 1.0};
    title = Papa Bear, this is Argonautae. The Radar Station has been destroyed. How copy?;
    };
     
    //==================================================================
    };

     

    I suppose you all get a little sneak-peak at my mission communications :D

  8. Okay, thanks Rarek.

    I'll take a look and let you know.

     

     

     

    == EDIT ==

     

    I took a look in CfgViewer,

    It appears that CfgRadio is not in the list but I still get the audio with radio effects from the radio itself if you have one.

    This is interesting...

    I tried to rename name and title (separately of course) and none worked. I am stumped!

     

    Hmm I saw that in the Scenarios that Bistudio made, they implemented CfgRadio but I am trying to find the files like in a .pbo format or something. Ideas where to find them? So I can see how they made theirs.

  9. Hey there Ahoyworld Community,

     

    I have a mission in the works at the moment and I am trying to add CfgRadio sounds so I can call them in the mission with a different script. Here is the code for CfgRadio:

     

     

    class CfgRadio
    {
    sounds[] = {};
     
    // Definition for each Radio Sound
    //==================================================================
     
    //Briefing Chat Section
     
    class brchat1
    {
    name = "brchat1";
    sound[] = {"\clips\briefingchat\briefingchat1.ogg", db-0.4, 1.0};
    titles[] = {Papa Bear, This is Argonautae, mission is a go.};
    };
     
    class brchat2
    {
    name = "brchat2";
    sound[] = {"\clips\briefingchat\briefingchat2.ogg", db-0.4, 1.0};
    titles[] = {Roger that Argonautae, just a word of warning... Be sure to destroy the communications tower before you destory the radar.};
    };
     
    class brchat3
    {
    name = "brchat3";
    sound[] = {"\clips\briefingchat\briefingchat3.ogg", db-0.4, 1.0};
    titles[] = {Roger that, Destroy the Communications Tower before destroying the radar.};
    };
     
    //==================================================================
     
    //Communications Tower is Down Section
     
    class ctdown1
    {
    name = "ctdown1";
    sound[] = {"\clips\ctdown\ctdown1.ogg", db-0.4, 1.0};
    titles[] = {0, ""};
    };
     
    class ctdownre
    name = "ctdownre";
    sound[] = {"\clips\ctdown\ctdownre.ogg", db-0.4, 1.0};
    titles[] = {0, ""};
    };
     
    //==================================================================
     
    //Radar Station Destroyed Section
     
    class rsdchat1
    {
    name = "rsdchat1";
    sound[] = {"\clips\rsd\rsdchat1.ogg", db-0.4, 1.0};
    titles[] = {0, ""};
    };
     
    //==================================================================
    };

     

    A side note: In notepad++ there are indentations unlike what's above.

     

    So here's the problem I have.

    When I call in my first Radio Sound, I get a pop up like what you see here

     

    But after I click 'Close' I can hear the sound clip no problem. So my question is: What's causing the popup to appear? How can I stop it?

     

    If you know the solution, please let me know!

×
×
  • Create New...