Programming Thread

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

0 Members and 7 Guests are viewing this topic.

the-pi-guy


public class Driver{
  public static void main(String[] args)
  {
   List l = new List();
    for(int i=0; i<12; i++){
     l.display();
     l.getNext();
     
    }
    System.exit(0);
  }
}

public class List{
  int[] current;
  int[] next;
 
  public List(){
    current = new int[1];
    next = new int[0];
    current[0] = 1;
  }
 
  public void add(int i){
    expand();
    next[next.length-1] = i;
   
  }
  public void expand(){
   int[] temp = new int[next.length+1];
    for(int i=0; i<next.length; i++){
      temp[i] = next[i];
    }
    next = temp;
  }
  public void getNext(){
    next = new int[0];
    for(int i =0; i<current.length; i++){
      if(current[i]>4 && (current[i]-4)%6==0){
       add(current[i]*2);
       add((current[i]-1)/3);
      }else{
        add(current[i]*2);
      }
     
    }
    current = next;
  }
 
  public int[] getCurr(){
   return current;
  }
 
  public void display(){
    for(int i =0; i<current.length; i++){
      System.out.print(current[i] + "   ");
    }
    System.out.println("");
   
  }
}

I threw together some code on my chromebook for the collatz conjecture.  And I don't really want to lose it.
It makes the tree of successors for where each values can go. 

Legend



Legend


the-pi-guy


darkknightkryta


Legend

Quote from: darkknightkryta on Jun 09, 2018, 02:20 AMI don't know, Python exists.
Hehe

I like python. Never really used it, but Blender uses it.

Quote from: the-Pi-guy on Jun 09, 2018, 01:54 AMspl/fibonacci.spl at master · flowerhack/spl · GitHub

This is the worst programming language.  
What does that example do?

the-pi-guy

Quote from: darkknightkryta on Jun 09, 2018, 02:20 AMI don't know, Python exists.
There are so many worse.  
Python is great. ::P

Quote from: Legend on Jun 09, 2018, 03:13 AMWhat does that example do?
I don't even know.  
I have a good idea of what a few lines do, but the whole thing is just bizarre.

darkknightkryta

Python is terrible.  I would honestly rather program in x86.

Legend

Quote from: darkknightkryta on Jun 09, 2018, 12:16 PMPython is terrible.  I would honestly rather program in x86.
Is that even doable?

the-pi-guy

Quote from: darkknightkryta on Jun 09, 2018, 12:16 PMPython is terrible.  I would honestly rather program in x86.
No it isn't.  
Quote from: Legend on Jun 09, 2018, 04:08 PMIs that even doable?
I'm assuming he means assembly.  
Unless he means binary.  Then he's way wrong.  

Legend

Quote from: the-Pi-guy on Jun 09, 2018, 04:21 PMNo it isn't.  I'm assuming he means assembly.  
Unless he means binary.  Then he's way wrong.  
Real Programmers

darkknightkryta

Yes I would rather cornver x86 assembly into binary than program Python

the-pi-guy

So a while ago, I made up a matching game for Android for Japanese words.  
I kind of gave up on it.  There was a weird blue screen that im not sure where it comes from and loading the words takes way too long.

 
I want to go back and fix it up though.  

Legend

Quote from: the-Pi-guy on Jun 23, 2018, 08:52 PMSo a while ago, I made up a matching game for Android for Japanese words.  
I kind of gave up on it.  There was a weird blue screen that im not sure where it comes from and loading the words takes way too long.

 
I want to go back and fix it up though.  
How were you loading the words?