Triple check that, will ya?

device-2017-03-08-124806A long long time ago
I can still remember how
That App used to make me smile….
And I knew if I had my chance
That I could make those dice dance
And maybe they’d be happy for a while….

Uh, wrong lyrics. Actually, it was quite a while ago that I made the Android app, Ships, Captain, and Crew! After the move from GitHub to GitLab, I decided to look over some of my old issues that were imported with GitLab’s great import tool. Among them, I found two issues for this old app that I had made.

The first was that of an issue with screen rotation causing the app to restart. I quickly fixed that by just setting the activity to portrait mode in the manifest file. You can check my commit if you need details.

The second issue was a bit more complicated, in that there was a problem with checking the dice for a ship, captain, or crew. Essentially, if you rolled a 4, 5, 6, 1, and 3, it would say you only have a ship (the 6) and no captain (5) or crew (4). Obviously that’s wrong. The issue is that you need a 6 before you can keep a 5 or 4. And since the dice were checked in order, when it looked at the 5 or 4, it did not have a 6 yet, so they were not “kept”.

This is how I fixed it:

for (int i = 0; i < 3; i++) {

// Check three times.

myNumber = firstDie;

diceCheck();

if (waschecked){

firstnotchecked = false;

}

dieOne.setImageResource(id);

myNumber = secondDie;

diceCheck();

if (waschecked){

secondnotchecked = false;

}

dieTwo.setImageResource(id);

myNumber = thirdDie;

diceCheck();

if (waschecked){

thirdnotchecked = false;

}

dieThree.setImageResource(id);

myNumber = fourthDie;

diceCheck();

if (waschecked){

fourthnotchecked = false;

}

dieFour.setImageResource(id);

myNumber = fifthDie;

diceCheck();

if (waschecked){

fifthnotchecked = false;

}


dieFive.setImageResource(id);


}

As you can see,  I told it to check the dice, first to last, three times. Yes, this is ugly and poor programming. Actually, I was almost ashamed of this early work, it looked so congested and terrible. However, my goal today was the quick fix, so that’s what I did. Hopefully, the update will be available on F-Droid soon, so you’ll have to check it out!

Linux – keep it simple.

Moving from GitHub to GitLab!

gitlab

I’m really not a conspiracy theorist. I don’t truly believe that Microsoft embodies all things evil. But after the announcement of GitHub’s purchase by Microsoft, I still decided to move away from GitHub and copy all my repositories over to GitLab.

I had several choices when making the move from GitHub, but I felt that GitLab’s open source platform was best in keeping with my goals as an (unskilled but learning) open source programmer. I also appreciate that you can download the GitLab software and run it yourself on your own server, which is something that I may look into in the future.

I have already copied all of my repositories to GitLab, and they have the same name and kept all of the commit history as well, thanks to GitLab’s great import tool. Over the next few weeks, I will be considering how to appropriately close and/or mark my GitHub repositories so that people will use the GitLab issue tracker and look to GitLab for updates. Thank you for your patience.

Going forward on this blog, I will be using GitLab and not GitHub. However, due to the volume of old posts I cannot take the time to change all of the old posts links. If you are looking for something older, and you can’t find it on GitHub, then try looking at GitLab, where the same repositories, issue trackers, and history of commits reside. I do apologize for any inconvenience that may cause.

In any event, agreed or not, you can still check out all of my work at https://gitlab.com/alaskalinuxuser , and thanks for reading my post.

Linux – keep it simple.