instruction
stringlengths
71
71.9k
This function takes an array of HTML objects and returns those currently on the screen. I try to optimize for readability and performance. I myself find this function a bit confusing. function(elements, margin) { var inViewport = []; if(elements.constructor !== Array){ elements = [elements]; } margin = mar...
I'm creating a database class. It's part academic and part something I may show in an interview. The purpose of this method is to accept a table name as a parameter, check if the PDO Object has been created (this is in an earlier method), check if the table is in the database as to white list the table for going furth...
This code checks winning conditions in Tic-Tac-Toe by checking if there is any row, column or diagonal with the same symbols. The board is a 2-dimensional array of chars. The character ' ' means that a field is empty. How can I refactor/simplify this code? public static bool SomeoneWins(char[][] board) { ...
I came up with this small implementation of an Okapi BM25+ ranker using Ruby. I cooked it up in a very short time so it's very simple but I'm trying to think whether there's a better way to write it. In particular, I'm wondering if I should have something like a Ranker class -- intuitively I feel as though I should but...
As a self-learning project, I wrote an expression parser using the shunting yard algorithm in JavaScript. It's a larger part of what I plan to be a program for handling dice expressions in tabletop games, like 2d6 (2 six-sided dice). I know a parsing library would be a better fit, but this is also a self-learning proj...
I'd like some feedback for the code I wrote. I haven't programmed in C++ for two years. #include <string> #pragma once template <class T> class StackLinkedList { public: StackLinkedList() : m_List(nullptr), m_Size(0) {} ~StackLinkedList(); void push(const T& val); void pop(); T& top(); const T&...
Currently, I'm working on a game with directional movement influenced by the numpad. The player AI should intelligently pick a direction to move (so it's not entirely random, and can be somewhat coherent). For reference, this is the numpad I'm using: 7 | 8 | 9 - - - - - 4 | x | 6 - - - - - 1 | 2 | 3 (5 is ignored as m...
In order to become more familiar with Perl I have implemented a code kata from here. The task was to write a program which prints out all anagrams for a given word. I'd appreciate your review of my solution: get_anagrams.pl use strict; use warnings; require 'anagrams.pm'; use feature 'say'; my $number_of_arguments ...
I wrote a SEDE query to list all tag wikis with a body or an excerpt under a given number of characters. I've used this to find empty wikis or wikis with very little information. The tags can be sorted by post count to make choosing which to improve easier. This is one of the first times I've written anything in SQL, I...
I've always been bothered by the fact that there weren't any built-in functions that could replace multiple substrings of a string in Python, so I created this function. Essentially, you supply it with a string, a dictionary of keys (substrings) and values (replacements), and then a few additional options. def keymap_r...
Intro I've been a desktop dev for a long time now, and have never really had to monkey with web development until very recently. I have a need to do some custom integration with Survey Monkey's Api and as a "Hello World" I came up with this simple ASP.Net MVC app that queries Survey Monkey for a list of my surveys and ...
Problem: Question 8: * Mergesort is a type of sorting algorithm. It follows a naturally recursive procedure: Break the input list into equally-sized halves Recursively sort both halves Merge the sorted halves. Using your merge function from the previous question, implement mergesort. Challenge: Implement merge...
Here's my JavaScript file that queries data from Parse and then updates my Handlebars.js template to display them. The code has 3 async calls using a Promise. It still feel like it could be improved, specifically in the Promises results loop where I check which i value it is. I'm not guaranteed that the bar we're on in...
I have written a python function that outputs scatter plots using Matplotlib after processing the data a little. It works but it's painfully slow. I was wondering if anybody had any suggestions as to how I can improve the efficiency of this function or whether its slow just because it's processing a lot of data (a 30x4...
(NOTE: Python2 only) It is part of a separate application that allows users to interact very loosely with different databases and check for possible errors and make corrections. try: import Tkinter as tk except ImportError: import tkinter as tk import tkFont import pandas class EditorApp: def __init__(s...
hashdic.h -- suggested for direct include or copy paste to your project. #include "string.h" // memcpy/memcmp typedef __uint32_t u32; typedef __int8_t i8; typedef __uint8_t u8; u32 MurMur(const char* key, int count) { #define muR(x, r) (((x) << r) | ((x) >> (32 - r))) u32 seed = 0x8e96a8f2; int n = count ...
I'm teaching myself Ruby by rewriting PHP solutions, such as this one. The program should match words in a sentence with a dictionary of synonyms and then make combinations with them. dict = { 'hello' => ['hey', 'what\'s up'], 'name' => ['nomenclature', 'epithet'] } str = 'hello, my name is' class SentenceMak...
I have implemented the heap sort algorithm which passes my tests. Although, I would like to ask you if I can improve anything from readability to performance. import java.util.List; /** * Created by Orestis on 17/07/2015 */ public class HeapSort { public static <T extends Comparable<? super T>> void sort(List<...
I've written a piece of code which utilizes a for loop to iterate this array in JavaScript. This is my first attempt and I wonder if there is an optimal way to do this. Fiddle JavaScript var gifCollection = { "gifs": [ { "gifName" : "gif-One", "gifLink" : "http://buffalogrove.sat.iit.edu/thumb/turkey_karadeniz_re...
This program is for constructing a symbol table where a key is a word and value is the frequency of the word in a text file and finding the word with maximum frequency. I did it in two ways: First I used Java's inbuilt TreeMap, which uses a red-black tree as internal data structure. Then I made my own implementation o...
I'm using io.js. I have to read some files as a stream, process them with the same function, and join them back into a stream. I decided to create my own solution with Transform streams and PassThrough streams. "use strict"; let fs=require('fs'); let filePaths=['./tmp/h.txt','./tmp/s.txt']; let Stream = requi...
Challenge: Write a program that will clean up the words from extra numbers and symbols. Specifications: The first argument is a path to a file. Each line includes a test case with a list of words: letters are both lowercase and uppercase, and are mixed with extra symbols. Print the words separated by spaces in ...
I'm trying to create a modern template class for a generic observable: typedef int SUBSCRIPTION_ID; template<typename EventType, typename Event> class Subject2 { typedef struct { std::function<void(const Event&)> method; int id; } Callable2; public: ...
Given two numbers L and R, find the highest occurring digit in the prime numbers present between L and R (both inclusive). If multiple digits have the same highest frequency print the largest of them. If there are no prime no.s between L and R, print -1. How can I optimize this code further in terms of running ...
Input given is: Each test case contains two lines. The first line contains a single integer N (1 ≤ N ≤ 105), the number of persons playing the game. The second line contains N integers i(height) (1 ≤ hi ≤ 109) the height of the i-th person. They are numbered 1 to N starting from Druid. Output given is: For each test...
Specification: Given a string (e.g., the content of an article), print the estimated reading time by bucketizing time into increasingly large chunks in the form "5-10 min" or "48 min-2 hr". Notes: Distribution of time into buckets is arbitrary, to make it "look nice" for the default 5-minute time chunks. This is oka...
I have implemented a trie data structure in my way, though it is very similar to what major implementations I found but would like to get it reviewed by experts. I don't see the need to store character in TrieContainer class as position within the series reflects the character stored. Maybe I am missing something and a...
Having written C# for half a year now, I decided to take on a fairly complex first challenge for C++: the Is it simple or it is hard? challenge from Code Golf Stack Exchange. (This is only practice, not an entry to the contest; my code is ~2,500 bytes so honestly submitting it would be a joke.) The rules of the contest...
I am upgrading a traditional jQuery based app by converting a few parts of it into ReactJs components and use Socket.io for the data transfer medium. There are a few React components spread across the page. The React components will receive updates from the socket connection in their componentDidMount method. For examp...
I'm using Google Play Services for Location in my Android app. This is my first app so I'm not expecting that I have utilized everything perfectly. My app is to get GPS/Date and send to a server database. I was hoping to learn (and everything works so far) if I've used Google Play Services code properly. I can only tes...
Here's the challenge description: A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24 hour period is $10.00. Assume that no car parks for longer than...
I have been trying out some stuff using inheritance with classes in Python 3.4. In the code below, I use the super() call to return the __str__ from the parent class. Is it correct coding practice to save the information returned by the parent class method in a variable, concatenate the __str__ from the child class to ...
I'm writing a 2D game engine, and I just wrote the physics for it to handle collisions between AABBs and circles. It's on GitHub. Some of my worries are that my code isn't OOP, because I have to do a bit of casting. As well as that, the engine doesn't seem to be deterministic, but rather depends on when the update meth...
I'm a beginner to Java and programming in general and since I'm on a holiday to the US, I thought it would be a fun idea to write a program for converting Fahrenheit to Celsius and the other way around. I'm using WindowBuilder for the gui part so I suppose my code could use some improvement. The main thing that's both...
I'm very new to Java and programming and I've written a calculator to put all the theory I've learned so far into practice. I'm sure there is a lot of room for improvement since I really just started learning. Any big mistakes you more experienced programmers notice immediately? I'm especially intrigued in how you can ...
This is a challenge question from codeeval.com: Given a sequence, write a program to detect cycles within it. Input sample: Your program should accept as its first argument a path to a filename containing a sequence of numbers (space delimited). The file can have multiple such lines. E.g 2 0 6 3 1 6 3 1 6 3 1 3...
I'm not familiar with Python but want to provide a code snippet for an SO question about Dynamic Programming. The snippet should show the bottom-up approach of DP. The function isPowerOfTwo returns True if the given number n is a power of two otherwise False. The implementation uses a button-up table results. def isPo...
I made the following program in Haskell to solve Project Euler's problem 92. The program works (i.e. the solution it yields is correct), but it's not exactly the fastest in the world. The problem is: A number chain is created by continuously adding the square of the digits in a number to form a new number until it h...
This is my attempt on the Conway's "Game of Life" using C++. The code is functional but I am sure most aspects of the code might have been poorly constructed as I am fairly new at this. Please give any suggestions on how to improve my coding standards such as coding style, syntax, naming convention, error handling (alt...
I want to get the row of data that matches the user ID I have. Then I want to return that view to my view to be displayed in my textboxes for editing. Here's the action that gets called when a get request to sent to the controller: public ActionResult EditUserAccount() { UserAccountViewModel editUserAccoun...
Challenge: Write a program which prints all the permutations of a string in alphabetical order. Specifications: Your program should accept a file as its first argument. The file contains input strings, one per line. Print the permutations of the string separated by commas, in alphabetical order. We consider...
Write a program that manipulates two strings. The program inputs two strings (string1 and string2) and a character (char1) and an integer (position) to represent a character position within a string. The program will display the following: Whether string1 is less, greater or equal to string2 string1 in upper ca...
I'm a newcomer to C++, from C#. I wrote a program that prints an ASCII checkerboard with a side length of the number passed to it (link to original Code Golf question). stdafx.h #include "targetver.h" #include <stdio.h> #include <tchar.h> #include <iostream> #include <sstream> #include <string> Checkers.cpp #include...
I am a Java programmer trying to learn the ways of Swift. I coded a Hangman game in Xcode. I was wondering what I could improve, specifically whether I used delegation correctly and if there is anything I can do more elegantly in Swift. Title View Controller import UIKit @IBDesignable class TitleViewController: UIView...
This is a Sudoku solver program which uses backtracking. It is a problem from Online Judge and I made it work after some struggle, but it needs to be faster as I'm getting a Time Limit Exceeded message. The input format: .46...9.. .3.1..... .2..6..85 ...87.... 6...3...4 ....14... 79..5..3. .....2.4. ..2...61. And then...
Today, I made a calculator in JFrame. The code is a little long but I'm still a beginner to Java. In the future I'm going to do some improvements on it, but here it is right now. This is the meat of the calculator: @SuppressWarnings("unused") public class CalcSubClass extends JFrame { private static final long seri...
Here's a function that allows you to convert an array of functions into an object of functions where each property is set to the name of the function. var _ = require("underscore") function functionName(fn){ //http://stackoverflow.com/a/17923727/340688 if(fn.name) return fn.name return /^function\s+([\w\$]+)\s*\...
I implemented the following class to dispatch std::function<void(void)> objects to a thread pool. Multiple threads will block on the pop call until a task is available. I am using the C++14 standard. #pragma once #include<memory> #include<queue> #include<mutex> #include<condition_variable> namespace alpha { temp...
I started Python 2-3 months ago, but I really haven't done much since then, just little things. Yesterday, I wrote this simple quadratic equation solver. You can give \$a, b\$ and \$c\$ any value, but they must all be integers. I really want to know what you think about it. from math import sqrt while True: tr...
HackerRank Problem Statement I have to find the largest 'decent number' having N digits. A decent number has the following properties: 3, 5, or both as its digits. No other digit is allowed. Number of times 3 appears is divisible by 5. Number of times 5 appears is divisible by 3. My code works perfect, but, I am afra...
When the user clicks the first button ('Back to List' button), I redirect the user to the Employee List page. Can you please review this and suggest if there is any better way of achieving the same? @using (@Html.BeginForm("Edit", "Employee", FormMethod.Post, new { id = "editEmployeeForm" })) { <div class="form-gro...
I was interested in the Code Golf challange about simple text. The spec is: Write a function that from a text returns the non-common words. I assumed non clean input so I cleaned it before proceding. The 'foo' 'barz' list is for easier testing. You may uncomment the line to read from a file. LETTERS = ('a'..'z').to_a...
I have a few confusions about writing Java code, and I need some clarifications: import java.util.Scanner; public class NameAbbreviation { private static String fullName; private static Scanner nameInput; public NameAbbreviation(String name) { NameAbbreviation.fullName = name; } public char getInitialLetterOfF...
I am teaching a python class to some high school seniors. I was thinking of doing an "oracle" game where the computer would come up with a number, and the player would guess it. These are brand new coders, and I'll teach them what they need to know to get there, but is this a good first project? I have my code here as ...
I'm developing an algorithm that takes structured light patterns to determine 3D properties of objects. This class builds the structured light objects. It creates a buffered image, and based upon initialization parameters and the needed iteration step, manipulates the image to form a structured light pattern that wil...
It seems that when I program in Lisp my brain goes on auto pilot and I end up solving the problem somehow. I don't even think I just do and it works out. That said, this is some horrible Lisp code that was hacked together in about 20 mins, just to see if I could do it. The C++ program that this is based off was about 1...
I am a beginner to Java and am learning about using methods. I want to make a simple calculator that uses methods effectively. I would like a review of my program, and I would also like to know if there is a better way or shortcuts to write this program better. I would like to know at the same time about good coding st...
Here's an excerpt from my migration script for my database for the new "remember me" login option for my web application. Logging in with a valid username/password combination (authenticate_user) will generate a new token and a hash of it is stored in the tokens table. When authenticating with a token (authenticate_to...
Recently I posted the following solution on Stack Overflow and comments made me to rethink about the time complexity of my solution which I am sure is \$O(V+E)\$. Please suggest reasons as to why I am wrong. import java.util.*; class Triangle { static ArrayList<LinkedList<Integer>> g; static int []visited; static i...
Is there anything specifically bad here, or anything that I could improve? Wasted lines of code, things done in a more memory intensive way than it could be, etc. from random import* b = 10 a = randint(1,b) point = 1 x = 1 while x < 2: print("Guess a number between 1 and ", b) svar = int (input()) if svar =...
I was working on a program that simulates the Buffon's Needle experiment. If anyone is not familiar with it, a Wiki link is provided - Buffons's Needle The point of Buffon's experiment is to find the value of pi, or at least approximate it. Usually you draw a couple of lines and then you scatter pins around the board ...
Is there anything I can improve in my UserManager class which saves and loads info about users connected to my server? import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException...
I am working on a site where I need to be able to accommodate frequent flyers but I am not so good at user interface design when I am given such a long leash. I am using ASP.NET (I am restricted by not being able to use MVC), I like the idea of using BootStrap but I am not familiar with it, and it's been a while sinc...
I like to create scripts that are clear as to what they do, I like comment, and use data- * in HTML to define what each component is. I created a script that creates a dropdown, that I can open and close. The result: /*! * Script needed to control the dropdown with the heading options in the new e-mail page * */ '...
Update: Simple Blackjack implementation I was playing Blackjack in a phone app and decided to try to do the game in Java, using the console for a start. So far I'd like to review the deck of cards implementation. I decided to use an OOP approach with the classes Value, Suit, Card and Deck. First of all, I'd like to get...
I wrote a simple JS app to generate passwords. I read up on some of the commenting standards for JS, and started reading the book Clean Code. I am not sure if I am writing the return statements correctly for some of my conditional test functions (e.g. hasAtLeastOne). I also tried to make my variable names semantic. ...
I am converting natural math expressions with fractions to Latex code. What I have done seems to work on examples I've tested, but I'm not sure if the algorithm is safe. And maybe the string part could be improved. Maybe a better approach could be replace the / from left to right, but how in my case target the next? B...
This is my implementation of Bitonic Tour (simplification of the Traveling Salesman Problem). Tests are not done very well, but it is not the point. I would be particularly interested in the comments on architecture and performance. NEW VERSION import math # see https://en.wikipedia.org/wiki/Bitonic_tour for the statem...
I'm pretty sure my code is mostly correct. I think I'm having formatting errors more than anything. I keep receiving warnings about "double to float and int to float,possible loss of data. Here is what I am trying to accomplish exactly. Write a function that accepts a pointer to a C- string as an argument and ca...
This is a graphical Tic Tac Toe game by using SFML cross-platform library. It seems to work fine. I'm actually new to SFML and making GUIs. If anyone is familiar with SFML, I'd appreciate some pointers on how to improve it. #include <SFML/Graphics.hpp> #include <iostream> #include <string> #include <vector> #include <a...
This is quite plain vanilla, but I'm hoping for Objective-C specific feedback. Also I'd be interested in what folks think about sorting in Objective-C vs. doing all sorting in C or C++ (and which?) even in an app. - (NSMutableArray *) quickSort: (NSMutableArray *)toSort{ for(NSNumber *arrayMember in toSort){ ...
The code below doesn't seem right to me. The scenario is: User enters in a "quantity" into a form field. If the user enters in 5, the loop below should iterate 5 times. There should now be 5 new entries in the database with the container.product and container.status. Any advice on making this cleaner? var container...
I've created two methods in a class that allow me to download the contents of an FTP folder and if specified then delete them. Although the code operates as intended I think it's vastly bloated and I'm looking for direction on how to correct it. Of note I believe that there's far too many FTP connections opened in a s...
I'm working on a warning system for my game. I want to display an arrow on the screen where the object is going to be coming from. Here is an image of what I have in mind: The object will spawn from outside the screen and start making its way to the screen. The code that I have created works, but it looks terrible. Ho...
This is a HackerEarth Challenge Problem. Question: Puchi hates to carry luggage, but unfortunately he got a job to carry the luggage of his N friends in office. Each day, one of his N friends, gives him the luggage of a particular weight to carry. You will be given the weight of luggage of each friend in the a...
I have implemented a binary search tree with the methods search, insert, and delete. I want to know if this is the best way to code them or if there are any other way by which I can reduce the code size or redundancies in code, if any. #include <bits/stdc++.h> using namespace std; struct node{ int val; node* l...
Building linked list abstraction using class 'list' data model. ################## # Linked List # ################## #Representation - start empty = 'empty' def is_link(s): """ s is a linked list if it is empty or a (first, rest) pair.""" return s == empty or (isinstance(s, list) and len(s) == 2 and is_l...
I wanted to come up with a 'utility' context to enable testing of the file system with behat. Specifically this is aimed at helping with the behavioral testing of php command line applications that work with the file system, or use a configuration file. I'd love for the whole repository to get a review, which has the c...
I am developing a service application that would implement a peer to peer messaging system. I am wondering if my following code is the best approach. It works, but I am naive and it would be nice to have validation from experts for performance and reliability. There would be about 5 plugins and a large number of messag...
I have a problem set which requires me to print all the multiples of a number in given range in reverse order. So far I have tried this but not sure it is optimized or not! #import <objc/objc.h> #import <objc/Object.h> @implementation TestObj int main() { int limit = 0; int divisor = 5; printf("enter a nu...
Recently I have found in my code several places where I was first gathering some solutions, and then continued processing them only if the solution was unique (solution collection contained only one element). Following code is an attempt to solve this in a more functional manner. implicit class GetOnlyOne[A](val coll...
This is working C++ code for Tic-Tac-Toe (even not using arrays): #include "stdafx.h" #include <iostream> using namespace std; using namespace System; int Decider(char a, char b, char c, char d, char e, char f, char g, char h, char i, int p); int Win(char a, char b, char c, char d, char e, char f, char g, char h, cha...
An implementation of BlockingQueue import java.util.LinkedList; import java.util.List; public class MyBlockingQueue<T> { List<T> queue = new LinkedList<T>(); private int limit = 0; public MyBlockingQueue(int limit) { this.limit = limit; } public synchronized void enqueue(T item) throws In...
An implementation of a ReentrantLock: public class ReentrantLock { private boolean isLocked = false; private Thread lockedBy = null; private int lockCount = 0; public synchronized void lock() throws InterruptedException{ while(isLocked && Thread.currentThread() != lockedBy){ this.wa...
I'm looking to make some improvements to a deliberately crude API written in PHP, it's designed to handle simple requests and talk to the DB. I have the following DB class: class DB { public function connect() { $serverName = "."; $connectionInfo = array("Database"=>"Demo","UID"=>"sa","PWD"=>"qw...
This is my first script in Python, and I am looking for tips and constructive criticism about code style, whether there are more efficient ways of doing things, etc. (not as interested in tips about the method, more so the actual code). Method: Choose random no. blocks (between 2 & 6) Decide whether to start vowel or...
I used saxon v9 to profile an XSL transformation which converts XML to JSON. The profiler tells me that the function which escapes certain characters takes about 70% of the total processing time. The conversion is important because otherwise the created JSON file will be invalid because of characters that break the str...
I have the following code which has too many loops inside it (almost 13 billion). This code is actually for image processing. I am first making a matrix of dimension 1024*360. This is the value of the projection data given to me. f is my image in the polar coordinate. The first loop gives me f in the polar-coordinate. ...
I have to measure execution time of certain sorting algorithms being passed as functions in following program. I also do not have to measure it on random container but also on ascending as well as descending sorted containers. Header file: #include <iostream> #include <vector> #include <chrono> #include <random> #inclu...
On page load, this script will locate all external links, and set their on click to open the page in a new window. "External links" includes pages that are on a different domain, PDF's on any domain, and any links with the class open-new. When a PDF is clicked, it also pings Google Analytics. This is using only pure Ja...
A question on Stack Overflow had me look up the article on bogosort on Wikipedia. There they describe the bogosort algorithm and the bogobogosort algorithm. They say, about this last algorithm, that: bogobogosort was designed not to succeed before the heat death of the universe on any sizable list. I wrote a program ...
I've been working on my own phone number extraction snippet of Regex code and I'd appreciate your feedback on it. I've tried to make it match as many different types of numbers as I knew existed in the US. (I'm sure there's some I missed.) Is there anything I can do to improve this? (?:\+?(\d{1})?-?\(?(\d{3})\)?[\s-\.]...
I would like to request some code review and feedback on a stack implementation using Swift. Disclaimer: I might have not used protocols, optional unwrapping and error and nil check correctly (still trying to figure out the essence of protocols - but that's the drill I'm going through now). import Foundation /* Node c...
This is my implementation of a Hash Table to store information about a student. Everything seems to work as expected, but I'd like some feedback on the following: Is my style good? Is it easy to read the code? Could i do better job naming variables? If so can you give examples? Would your implementation of a hash tabl...
Continuing my previous post, I have completed my game of Blackjack, the simple version. I am aware it's very long. I haven't included some of the suggested changes suggested in the previously to the Deck implementation and the other classes involved. It is simple because I omitted some rules (I am planning on implement...
I have written the following C code to parse a configuration file for settings to my program. I denote comments with a # and blank lines are allowed. e.g.: # Total bytes per line TBPL 70 # bar minimum NUMIN 10. # bar maximum NUMAX 30000. # input filename LLIST_NAME foo.txt Is there anything badly wrong here? I'm use...
I plan to use this menu struct in an RPG played in the terminal. I want to make a RPG similar to D&D. I would like advice on my methods for the menu struct, especially the "hide" and "unhide" option methods. main.cpp #include <string> #include <vector> #include <cstdlib> #include <iostream> #include <initializer_list>...
How can I do the following with less nested loops. How can I output the Table names above their corresponding tables without having to loop. Functions for returning the DB Info: // Return all the Table names in an array public function getDbTables() { $result = $this->query("SHOW TABLES"); while ($row...
I wanted to create a class that would allow me to draw an arc representing a percentage of progress, similar to the activity view on the Apple watch. There are various examples which I found helpful on the web and my output is a combination of many of these. I have posted my code so that it works and renders in a Xcode...
A while ago I got bored and being the beginner programmer I am I made a Russian Roulette game in Java using JFrame. The first few windows are JOptionPanes that are a welcoming screen, an update log and a how to play. The object of the game is you get 5 lives and when you lose all of your lives, you die. At the very end...